class SomeClass:
SOME_CONST = "hello"
SOME_OTHER_CONST = SomeClass.SOME_CONST + " world"
This doesn't work.
NameError: name 'SomeClass' is not defined
Is there any way to refer to the class within the class?
class SomeClass:
SOME_CONST = "hello"
SOME_OTHER_CONST = SomeClass.SOME_CONST + " world"
This doesn't work.
NameError: name 'SomeClass' is not defined
Is there any way to refer to the class within the class?
You don't need the class name
class SomeClass:
SOME_CONST = "hello"
SOME_OTHER_CONST = SOME_CONST + " world"