February 2006
Intermediate to advanced
648 pages
14h 53m
English
The functions in Tables 27.10 through 27.22 can be used to manipulate specific built-in types. Functions of the form Py<type>_Check() are used to check the type of an object and return 1 if an object is the correct type, 0 otherwise. Functions of the form Py<type>_CheckExact() perform the same task, but make sure that the object is exactly the appropriate type—not a type that has been derived via inheritance. Functions of the form Py<type>_From<type> are used to create a Python object from a C data type. Functions of the form Py<type>_As<type> are used to convert from Python to C.
| Type | Function |
|---|---|
| long | PyInt_AsLong(PyObject *iobj); |
| int | PyInt_Check(PyObject *obj) |
| int | PyInt_CheckExact(PyObject |
Read now
Unlock full access