I have a class that has a class variable and a static method and I need to let the class variable contain a callback to the static method.
The class looks like:
class Test(object):
ref = ???? #this should be my reference
@staticmethod
def testmethod(anyparam="bla"):
print "it works"
How can I do this? Is this even possible?
I am using python 2
EDIT: The real example is this:
class reg(cmd):
bla = {
'def': [ ... ],
'rem': [ ...,
PIPE.return_response(fail_callback=HERE_I_NEED_THE_REF),
...
]
}
@classmethod
def testmethod(cls, aco):
print "i want to see this on fail"
Test.ref = 'XXX'