diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-09-13 05:38:56 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-09-13 05:38:56 (GMT) |
commit | 59c9a645e2f44b0b546225678d704787d9eae35d (patch) | |
tree | 56179a5250e747d330a93b4f5fe66eeb65859329 /Include | |
parent | 93a696f49171c0593b23817bbf56ab44269a9587 (diff) | |
download | cpython-59c9a645e2f44b0b546225678d704787d9eae35d.zip cpython-59c9a645e2f44b0b546225678d704787d9eae35d.tar.gz cpython-59c9a645e2f44b0b546225678d704787d9eae35d.tar.bz2 |
SF bug [#460467] file objects should be subclassable.
Preliminary support. What's here works, but needs fine-tuning.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/fileobject.h | 3 | ||||
-rw-r--r-- | Include/moduleobject.h | 1 |
2 files changed, 3 insertions, 1 deletions
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 "C" { 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); diff --git a/Include/moduleobject.h b/Include/moduleobject.h index 8c3ba61..533567c 100644 --- a/Include/moduleobject.h +++ b/Include/moduleobject.h @@ -10,6 +10,7 @@ extern "C" { extern DL_IMPORT(PyTypeObject) PyModule_Type; #define PyModule_Check(op) PyObject_TypeCheck(op, &PyModule_Type) +#define PyModule_CheckExact(op) ((op)->ob_type == &PyModule_Type) extern DL_IMPORT(PyObject *) PyModule_New(char *); extern DL_IMPORT(PyObject *) PyModule_GetDict(PyObject *); |