V
venk
Hi,
given below is my interaction with the interpreter.... In one case, i
have created the class method using the "famous idiom"... and in the
other, i have tried to create it outside the class definition... why
isn't the latter working ? (of course, the presence of decorators is a
different issue)........ def f(cls):
.... print cls
....Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: unbound method f() must be called with D instance as first
argument (got classobj instance instead).... def f(cls):
.... print cls
.... f=classmethod(f)
....__main__.D
given below is my interaction with the interpreter.... In one case, i
have created the class method using the "famous idiom"... and in the
other, i have tried to create it outside the class definition... why
isn't the latter working ? (of course, the presence of decorators is a
different issue)........ def f(cls):
.... print cls
....Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: unbound method f() must be called with D instance as first
argument (got classobj instance instead).... def f(cls):
.... print cls
.... f=classmethod(f)
....__main__.D