mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Patch #530105: Allow file object may to be subtyped
This commit is contained in:
parent
d36cfe495e
commit
f6eebbb435
2 changed files with 11 additions and 11 deletions
|
@ -7,6 +7,17 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#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;
|
extern DL_IMPORT(PyTypeObject) PyFile_Type;
|
||||||
|
|
||||||
#define PyFile_Check(op) PyObject_TypeCheck(op, &PyFile_Type)
|
#define PyFile_Check(op) PyObject_TypeCheck(op, &PyFile_Type)
|
||||||
|
|
|
@ -38,17 +38,6 @@
|
||||||
#endif
|
#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 *
|
FILE *
|
||||||
PyFile_AsFile(PyObject *f)
|
PyFile_AsFile(PyObject *f)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue