PyCObject subtype PyObject
Benjamin Tai
bt98 at doc.ic.ac.uk
Sat Jun 8 11:47:51 EDT 2002
Hi,
Any comments to clarify my confusion would be appreciated.
In Python/C API Reference Manual, section 7.5.9 CObjects, the document
mentions that:
"PyCObject This subtype of PyObject represents an opaque value, ..."
1) What does it mean by "subtype"? As a C interface, is the document
talking about two structs which share some common fields?
2) For function "PyCObject_FromVoidPtr()", it takes in a "void*" as the
first argument.
For function "PyCObject_AsVoidPtr()", it returns a "void*".
When implementing Python extension, what is the potential danger of
casting pointers, of different size, to and from "void*"?
3) What if I can always determine the original type of the pointer?
4) Apart from exporting function between modules, are there any examples
of using PyCObject?
Thanks
Ben
More information about the Python-list
mailing list