Abstract Object Layer
The functions in Tables 27.4 through 27.9 are used to manipulate objects from C, much in 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.
Type ... |
---|
Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.