Extending Python: rewriting a single method in C
Fredrik Lundh
fredrik at pythonware.com
Tue Mar 13 14:57:00 EST 2001
Jacek Generowicz wrote:
> (Would it be fair to say that the documentaion is, on the whole, less
> that satisfactory ?)
are you sure you read the C API docs before posting?
http://www.python.org/doc/current/api/objects.html
explains how PyObject's work.
http://www.python.org/doc/current/api/concrete.html
explains how to deal with objects of a known type.
http://www.python.org/doc/current/api/object.html
explains the abstract object interface, including the functions
you mention:
PyObject* PyObject_GetAttrString (PyObject *o, char *attr_name)
Return value: New reference.
Retrieve an attribute named attr_name from object o. Returns
the attribute value on success, or NULL on failure. This is the
equivalent of the Python expression "o.attr_name".
etc.
Cheers /F
More information about the Python-list
mailing list