There are some useful functions that are useful for working with method objects.
This instance of PyTypeObject represents the Python method type. This is exposed to Python programs as types.MethodType.
Return a new method object, with func being any callable object; this is the function that will be called when the method is called. If this method should be bound to an instance, self should be the instance and class should be the class of self, otherwise self should be NULL and class should be the class which provides the unbound method..
Return the class object from which the method meth was created; if this was created from an instance, it will be the class of the instance.
Macro version of PyMethod_Class() which avoids error checking.
Return the function object associated with the method meth.
Macro version of PyMethod_Function() which avoids error checking.
Return the instance associated with the method meth if it is bound, otherwise return NULL.
Macro version of PyMethod_Self() which avoids error checking.
Clear the free list. Return the total number of freed items.
New in version 2.6.