Checking to see if m.im_self is the class works some of the time but doesn't seem to be 100% reliable (ex. if you use multiple decorators on a method.)
views:
92answers:
1
+2
A:
If it's a bound method on the class then it's a classmethod.
from inspect import ismethod, isclass
def isclassmethod( m ):
return ismethod(m) and isclass(m.__self__)
THC4k
2009-11-06 13:52:42