mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -46,10 +46,10 @@ PyAPI_DATA(PyTypeObject) _PyWeakref_CallableProxyType;
|
|||
|
||||
#define PyWeakref_CheckRef(op) PyObject_TypeCheck(op, &_PyWeakref_RefType)
|
||||
#define PyWeakref_CheckRefExact(op) \
|
||||
(Py_TYPE(op) == &_PyWeakref_RefType)
|
||||
Py_IS_TYPE(op, &_PyWeakref_RefType)
|
||||
#define PyWeakref_CheckProxy(op) \
|
||||
((Py_TYPE(op) == &_PyWeakref_ProxyType) || \
|
||||
(Py_TYPE(op) == &_PyWeakref_CallableProxyType))
|
||||
(Py_IS_TYPE(op, &_PyWeakref_ProxyType) || \
|
||||
Py_IS_TYPE(op, &_PyWeakref_CallableProxyType))
|
||||
|
||||
#define PyWeakref_Check(op) \
|
||||
(PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue