Refer to class variable in another class variable definition

python

Solution

You don't need the class name

class SomeClass:
   SOME_CONST = "hello"
   SOME_OTHER_CONST = SOME_CONST + " world"

Problem

``` 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?

Original source

Related problems