Yurttas/PL/SL/python/docs/core-python-programming/doc/20/api/common-structs.html


10.1 Common Object Structures

PyObject, PyVarObject

PyObject_HEAD, PyObject_HEAD_INIT, PyObject_VAR_HEAD

Typedefs: unaryfunc, binaryfunc, ternaryfunc, inquiry, coercion, intargfunc, intintargfunc, intobjargproc, intintobjargproc, objobjargproc, destructor, printfunc, getattrfunc, getattrofunc, setattrfunc, setattrofunc, cmpfunc, reprfunc, hashfunc

PyCFunction
Type of the functions used to implement most Python callables in C.
PyMethodDef
Structure used to describe a method of an extension type. This structure has four fields: {| style="border-collapse: collapse" border="border" align="center"

! align="left" | Field ! align="left" | C Type ! align="left" | Meaning | align="left" valign="baseline" | ml_name | align="left" | char * | align="left" | name of the method |- | align="left" valign="baseline" | ml_meth | align="left" | PyCFunction | align="left" | pointer to the C implementation |- | align="left" valign="baseline" | ml_flags | align="left" | int | align="left" | flag bits indicating how the call should be constructed |- | align="left" valign="baseline" | ml_doc | align="left" | char * | align="left" | points to the contents of the docstring |}

PyObject* Py_FindMethod (PyMethodDef[] table, PyObject *ob, char *name)
Return value: New reference.
Return a bound method object for an extension type implemented in C. This function also handles the special attribute __methods__, returning a list of all the method names defined in table.

See About this document... for information on suggesting changes.