Closed dimaqq closed 4 years ago
The implementation of inspect.ismethod()
is:
def ismethod(object):
"""Return true if the object is an instance method.
Instance method objects provide these attributes:
__doc__ documentation string
__name__ name with which this method was defined
__func__ function object containing implementation of method
__self__ instance to which this method is bound"""
return isinstance(object, types.MethodType)
The wrapped callable need not be an instance of types.MethodType
. For example, in the case of nested decorators.
Make perfect sense!
Would this be cleaner test than
instance is not None and not isclass(wrapped)
?Or am I missing a corner case?