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).... >>> class D: ... def f(cls): ... print cls ... >>> D.f=classmethod(D.f) >>> D.f <bound method classobj.f of <class __main__.D at 0xb7c99f5c>> >>> D.f() 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) >>> class D: ... def f(cls): ... print cls ... f=classmethod(f) ... >>> D.f <bound method classobj.f of <class __main__.D at 0xb7c9947c>> >>> D.f() __main__.D
-- http://mail.python.org/mailman/listinfo/python-list