]> granicus.if.org Git - python/commitdiff
Patch #530105: Allow file object may to be subtyped
authorMartin v. Löwis <martin@v.loewis.de>
Fri, 15 Mar 2002 17:42:16 +0000 (17:42 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Fri, 15 Mar 2002 17:42:16 +0000 (17:42 +0000)
Include/fileobject.h
Objects/fileobject.c

index 632c436c3308c3aac3be6277cb878ace3e6d9a6c..0876cd29a880d963441281eddaa0e0776b2861c9 100644 (file)
@@ -7,6 +7,17 @@
 extern "C" {
 #endif
 
+typedef struct {
+       PyObject_HEAD
+       FILE *f_fp;
+       PyObject *f_name;
+       PyObject *f_mode;
+       int (*f_close)(FILE *);
+       int f_softspace; /* Flag used by 'print' command */
+       int f_binary; /* Flag which indicates whether the file is
+                        open in binary (1) or test (0) mode */
+} PyFileObject;
+
 extern DL_IMPORT(PyTypeObject) PyFile_Type;
 
 #define PyFile_Check(op) PyObject_TypeCheck(op, &PyFile_Type)
index 7bcc82aa1c52f0bf18f18aa99cab1a40ff05b884..c8fb214e2fcbd46ad9671ce23f7044e1c021f18a 100644 (file)
 #endif
 
 
-typedef struct {
-       PyObject_HEAD
-       FILE *f_fp;
-       PyObject *f_name;
-       PyObject *f_mode;
-       int (*f_close)(FILE *);
-       int f_softspace; /* Flag used by 'print' command */
-       int f_binary; /* Flag which indicates whether the file is open
-                        open in binary (1) or test (0) mode */
-} PyFileObject;
-
 FILE *
 PyFile_AsFile(PyObject *f)
 {