test if PyObject * points to real python object

"Martin v. Löwis" martin at v.loewis.de
Mon Jun 21 02:11:13 EDT 2004


David McNab wrote:
> With the Python/C API, how do i test if a given PyObject * actually 
> points to a real/valid python object?

As opposed to being a NULL pointer? o != NULL

As opposed to being a stray pointer, to garbage memory? You can't.

Regards,
Martin




More information about the Python-list mailing list