MCPcopy Create free account
hub / github.com/numpy/numpy / ismethod

Function ismethod

numpy/_utils/_inspect.py:13–24  ·  view source on GitHub ↗

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 im_class class object in which this method belongs im_func

(object)

Source from the content-addressed store, hash-verified

11
12# ----------------------------------------------------------- type-checking
13def ismethod(object):
14 """Return true if the object is an instance method.
15
16 Instance method objects provide these attributes:
17 __doc__ documentation string
18 __name__ name with which this method was defined
19 im_class class object in which this method belongs
20 im_func function object containing implementation of method
21 im_self instance to which this method is bound, or None
22
23 """
24 return isinstance(object, types.MethodType)
25
26def isfunction(object):
27 """Return true if the object is a user-defined function.

Callers 1

getargspecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected