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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With