mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01: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
|
|
@ -70,6 +70,14 @@ the definition of all other Python objects.
|
|||
(((PyObject*)(o))->ob_type)
|
||||
|
||||
|
||||
.. c:function:: int Py_IS_TYPE(PyObject *o, PyTypeObject *type)
|
||||
|
||||
Return non-zero if the object *o* type is *type*. Return zero otherwise.
|
||||
Equivalent to: ``Py_TYPE(o) == type``.
|
||||
|
||||
.. versionadded:: 3.9
|
||||
|
||||
|
||||
.. c:function:: void Py_SET_TYPE(PyObject *o, PyTypeObject *type)
|
||||
|
||||
Set the object *o* type to *type*.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue