Register   Login   About   Study   Enterprise   Share
AI / Internet Technology University (AITU)
Fast Login - available after registration







|

Top Links: >> 80. Technology >> Internet Technology Summit Program >> 9. AI with Python >> 9.1. The Python Tutorial Introduction >> 9.1.1. Python Docs, Lexicon, and Components >> 9.1.1.3. Python Internals
Current Topic: 9.1.1.3.39. Instance Method Objects
You have a privilege to create a quiz (QnA) related to this subject and obtain creativity score...

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).




PyTypeObject
PyInstanceMethod_Type



This instance of PyTypeObject represents the Python instance method type. It is not exposed to Python programs.






int
PyInstanceMethod_Check
(
PyObject
 *o
)



Return true if o is an instance method object (has type PyInstanceMethod_Type). The parameter must not be NULL.






PyObject*
PyInstanceMethod_New
(
PyObject
 *func
)



Return value: New reference.

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.






PyObject*
PyInstanceMethod_Function
(
PyObject
 *im
)



Return value: Borrowed reference.

Return the function object associated with the instance method im.






PyObject*
PyInstanceMethod_GET_FUNCTION
(
PyObject
 *im
)



Return value: Borrowed reference.

Macro version of PyInstanceMethod_Function() which avoids error checking.







Method Objects


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
PyMethod_Type



This instance of PyTypeObject represents the Python method type. This is exposed to Python programs as types.MethodType.






int
PyMethod_Check
(
PyObject
 *o
)


Was it clear so far?

Return true if o is a method object (has type PyMethod_Type). The parameter must not be NULL.






PyObject*
PyMethod_New
(
PyObject
 *func,
PyObject
 *self
)



Return value: New reference.

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.






PyObject*
PyMethod_Function
(
PyObject
 *meth
)



Return value: Borrowed reference.

Return the function object associated with the method meth.






PyObject*
PyMethod_GET_FUNCTION
(
PyObject
 *meth
)



Return value: Borrowed reference.

Macro version of PyMethod_Function() which avoids error checking.






PyObject*
PyMethod_Self
(
PyObject
 *meth
)



Return value: Borrowed reference.

Return the instance associated with the method meth.






PyObject*
PyMethod_GET_SELF
(
PyObject
 *meth
)



Return value: Borrowed reference.

Macro version of PyMethod_Self() which avoids error checking.






int
PyMethod_ClearFreeList
(
)



Clear the free list. Return the total number of freed items.








| Check Your Progress | Propose QnA | Have a question or comments for open discussion?

Have a suggestion? - shoot an email
Looking for something special? - Talk to me
Read: IT of the future: AI and Semantic Cloud Architecture | Fixing Education
Do you want to move from theory to practice and become a magician? Learn and work with us at Internet Technology University (ITU) - JavaSchool.com.

Technology that we offer and How this works: English | Spanish | Russian | French

Internet Technology University | JavaSchool.com | Copyrights © Since 1997 | All Rights Reserved
Patents: US10956676, US7032006, US7774751, US7966093, US8051026, US8863234
Including conversational semantic decision support systems (CSDS) and bringing us closer to The message from 2040
Privacy Policy