test if PyObject * points to real python object
jepler at unpythonic.net
Wed Jun 23 23:09:46 CEST 2004
On Sat, Jun 19, 2004 at 03:11:32PM +1200, David McNab wrote:
> With the Python/C API, how do i test if a given PyObject * actually
> points to a real/valid python object?
In most places in the API, it's illegal for a PyObject* to point to
something other than a real/valid Python object, except that sometimes
NULL is allowed instead. With proper refcounting, it's impossible for a
valid pointer to become invalid.
So, really, the way you tell is by the absence of a "signal 11" or
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 196 bytes
Desc: not available
More information about the Python-list