En Fri, 29 May 2009 08:48:26 -0300, Benjamin Peterson <benja...@python.org> escribió:

Joachim Dahl <dahl.joachim <at> gmail.com> writes:

How do I perform type checking for such an object in the extension
module,
and how do I extract a FILE * object from it?  I browsed the C API
documentation,  but
couldn't find an answer.

You use PyObject_IsInstance to test if the object is an instance of io.IOBase.

But you have to import the io module first, don't you? That's not usually necesary for most built in types -- e.g. PyFloat_Check just checks for a float object.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to