mirror of
https://github.com/python/cpython.git
synced 2025-07-31 07:04:42 +00:00
bpo-39573: Add Py_IS_TYPE() function (GH-18488)
Co-Author: Neil Schemenauer <nas-github@arctrix.com>
This commit is contained in:
parent
968dcd9e7a
commit
d905df766c
32 changed files with 61 additions and 46 deletions
|
@ -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 *);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue