SF bug [#460467] file objects should be subclassable.
Preliminary support. What's here works, but needs fine-tuning.
diff --git a/Include/fileobject.h b/Include/fileobject.h
index a3670c2..94d3591 100644
--- a/Include/fileobject.h
+++ b/Include/fileobject.h
@@ -9,7 +9,8 @@
extern DL_IMPORT(PyTypeObject) PyFile_Type;
-#define PyFile_Check(op) ((op)->ob_type == &PyFile_Type)
+#define PyFile_Check(op) PyObject_TypeCheck(op, &PyFile_Type)
+#define PyFile_CheckExact(op) ((op)->ob_type == &PyFile_Type)
extern DL_IMPORT(PyObject *) PyFile_FromString(char *, char *);
extern DL_IMPORT(void) PyFile_SetBufSize(PyObject *, int);