diff options
author | Dong-hee Na <donghee.na92@gmail.com> | 2020-02-14 02:37:17 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-13 18:37:17 +0100 |
commit | d905df766c367c350f20c46ccd99d4da19ed57d8 (patch) | |
tree | 9e08a6c88d6b0dd4e73810c3f3a152b61bd773aa /Include/genobject.h | |
parent | 968dcd9e7a4d3aa9aaa1dfca693adf60d6b71ce7 (diff) | |
download | cpython-git-d905df766c367c350f20c46ccd99d4da19ed57d8.tar.gz |
bpo-39573: Add Py_IS_TYPE() function (GH-18488)
Co-Author: Neil Schemenauer <nas-github@arctrix.com>
Diffstat (limited to 'Include/genobject.h')
-rw-r--r-- | Include/genobject.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Include/genobject.h b/Include/genobject.h index 5ee9a2831d..b87a648563 100644 --- a/Include/genobject.h +++ b/Include/genobject.h @@ -38,7 +38,7 @@ typedef struct { PyAPI_DATA(PyTypeObject) PyGen_Type; #define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type) -#define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type) +#define PyGen_CheckExact(op) Py_IS_TYPE(op, &PyGen_Type) PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *); PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(struct _frame *, @@ -58,7 +58,7 @@ typedef struct { PyAPI_DATA(PyTypeObject) PyCoro_Type; PyAPI_DATA(PyTypeObject) _PyCoroWrapper_Type; -#define PyCoro_CheckExact(op) (Py_TYPE(op) == &PyCoro_Type) +#define PyCoro_CheckExact(op) Py_IS_TYPE(op, &PyCoro_Type) PyObject *_PyCoro_GetAwaitableIter(PyObject *o); PyAPI_FUNC(PyObject *) PyCoro_New(struct _frame *, PyObject *name, PyObject *qualname); @@ -89,7 +89,7 @@ PyAPI_DATA(PyTypeObject) _PyAsyncGenAThrow_Type; PyAPI_FUNC(PyObject *) PyAsyncGen_New(struct _frame *, PyObject *name, PyObject *qualname); -#define PyAsyncGen_CheckExact(op) (Py_TYPE(op) == &PyAsyncGen_Type) +#define PyAsyncGen_CheckExact(op) Py_IS_TYPE(op, &PyAsyncGen_Type) PyObject *_PyAsyncGenValueWrapperNew(PyObject *); |