It would be nice if classmethod/staticmethod exposed the wrapped function as a read-only attribute/property. Currently the function can be retrieved indirectly but it's obscure (and perhaps not always correct, I'm not sure): In [147]: def f():pass .....: In [148]: c = classmethod(f) In [149]: s = staticmethod(f) In [150]: c.__get__(1).im_func is f Out[150]: True In [151]: s.__get__(1) is f Out[151]: True
Having to bind and unbind a classmethod to get at the function is definitely a bit weird, and also susceptible to changing implementation, but do you have a practical use case to motivate the effort needed? In Py3, '__func__' replaced 'im_func', and that is the name to use if the attribute is added. A change in 3.2 is at least as likely as a change in 2.7.
I don't remember the exact use case but it had to do with making a decorator robust enough to work for different kinds of callables (and a few common non-callables such as classmethod/staticmethod). It's not a show stopper by any means but I thought it would be easy (if not trivial) to implement, and regardless of actual use cases I don't see a reason to keep the function "hidden".