I know this is probably not a good style, but I was wondering if it is possible to construct a class when a static method is called
class myClass():
def __init__(self):
self.variable = "this worked"
@staticmethod
def test_class(var=myClass().variable):
print self.variable
if "__name__" == "__main__":
myClass.test_class()
Right now it returns
NameError: name 'myClass' is not defined
Here is what I am suspecting, in default, the python interpreter will scan the class and register each function, when it register the function, it checks the function's default variable, the default variable have to be defined?