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.