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) .
PyCFunction
PyMethod_New(func, NULL, class)
此实例的 PyTypeObject represents the Python instance method type. It is not exposed to Python programs.
PyTypeObject
返回 True 若 o is an instance method object (has type PyInstanceMethod_Type ). The parameter must not be NULL . This function always succeeds.
PyInstanceMethod_Type
NULL
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_Function() which avoids error checking.
PyInstanceMethod_Function()
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.
此实例的 PyTypeObject represents the Python method type. This is exposed to Python programs as types.MethodType .
types.MethodType
返回 True 若 o is a method object (has type PyMethod_Type ). The parameter must not be NULL . This function always succeeds.
PyMethod_Type
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 不得为 NULL .
Return the function object associated with the method meth .
Macro version of PyMethod_Function() which avoids error checking.
PyMethod_Function()
Return the instance associated with the method meth .
Macro version of PyMethod_Self() which avoids error checking.
PyMethod_Self()
函数对象
单元格对象
键入搜索术语或模块、类、函数名称。