tags:

views:

92

answers:

1

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.)

+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