Instance Method Objects
pair: object; instancemethod
An instance method is a wrapper for a PyCFunction and the new way to bind a PyCFunction to a class object. It replaces the former call PyMethod_New(func, NULL, class).
This instance of
PyTypeObjectrepresents the Python instance method type. It is not exposed to Python programs.
Return true if o is an instance method object (has type
PyInstanceMethod_Type). The parameter must not beNULL. This function always succeeds.
Return a new instance method object, with func being any callable object. func is the function that will be called when the instance method is called.
Return the function object associated with the instance method im.
Macro version of
PyInstanceMethod_Functionwhich avoids error checking.
Method Objects
pair: object; method
Methods are bound function objects. Methods are always bound to an instance of a user-defined class. Unbound methods (methods bound to a class object) are no longer available.
single: MethodType (in module types)
This instance of
PyTypeObjectrepresents the Python method type. This is exposed to Python programs astypes.MethodType.
Return true if o is a method object (has type
PyMethod_Type). The parameter must not beNULL. This function always succeeds.
Return a new method object, with func being any callable object and self the instance the method should be bound. func is the function that will be called when the method is called. self must not be
NULL.
Return the function object associated with the method meth.
Macro version of
PyMethod_Functionwhich avoids error checking.
Return the instance associated with the method meth.
Macro version of
PyMethod_Selfwhich avoids error checking.