O'Reilly logo

Python Essential Reference, Second Edition by David M Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Abstract Object Layer

The functions in Tables B.4 through B.8 are used to manipulate objects from C, in much the same manner as from the interpreter. All the functions in this section that return an int return -1 if an error occurs. Likewise, functions that return a PyObject * return NULL on failure. Note that an “error” in this context is not the same as the false result of a test. For instance, the PyNumber_Check(PyObject *obj ) function returns 0 if obj is not a number, but this isn’t the same as an error. Finally, unless otherwise noted, all functions in this section that return a PyObject * return ownership with the object. It’s up to the caller to decrement the reference count of the returned object if necessary.

Table B.4. Objects
Type ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required