isinstancemethod(cls, obj)
This requires both the class the object is a member of as well as the object itself in order to make this determination.
The class on which this method was defined.
A member of the provided class (the membership is not checked directly, but this function will always return :None:None:`False`
if the given object is not a member of the given class).
Returns :None:None:`True`
if the given object is an instance method of the class it is defined on (as opposed to a :None:None:`staticmethod`
or a :None:None:`classmethod`
).
>>> class MetaClass(type):This example is valid syntax, but we were not able to check execution
... def a_classmethod(cls): pass ...
>>> class MyClass(metaclass=MetaClass):This example is valid syntax, but we were not able to check execution
... def an_instancemethod(self): pass ... ... @classmethod ... def another_classmethod(cls): pass ... ... @staticmethod ... def a_staticmethod(): pass ...
>>> isinstancemethod(MyClass, MyClass.a_classmethod) FalseThis example is valid syntax, but we were not able to check execution
>>> isinstancemethod(MyClass, MyClass.another_classmethod) FalseThis example is valid syntax, but we were not able to check execution
>>> isinstancemethod(MyClass, MyClass.a_staticmethod) FalseThis example is valid syntax, but we were not able to check execution
>>> isinstancemethod(MyClass, MyClass.an_instancemethod) TrueSee :
The following pages refer to to this document either explicitly or contain code examples using this.
astropy.utils.introspection.isinstancemethod
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them