Defining constants in python class, is self really needed?
Defining constants in python class, is self really needed? Question: I want to define a set of constants in a class like: class Foo(object): (NONEXISTING,VAGUE,CONFIRMED) = (0,1,2) def __init__(self): self.status = VAGUE However, I get NameError: global name ‘VAGUE’ is not defined Is there a way of defining these constants to be visiable inside the …
Total answers: 5