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:

Field  C Type  Meaning 
ml_name char * name of the method
ml_meth PyCFunction pointer to the C implementation
ml_flags int flag bits indicating how the call should be constructed
ml_doc char * 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.