Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Doc/c-api/type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ Type Objects
Type features are denoted by single bit flags.


.. c:function:: int PyType_FastSubclass(PyTypeObject *type, int flag)

Return non-zero if the type object *type* sets the subclass flag *flag*.
Subclass flags are denoted by
:c:macro:`Py_TPFLAGS_*_SUBCLASS <Py_TPFLAGS_LONG_SUBCLASS>`.
Comment thread
StanFromIreland marked this conversation as resolved.


.. c:function:: int PyType_IS_GC(PyTypeObject *o)

Return true if the type object includes support for the cycle detector; this
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
.. c:macro:: Py_TPFLAGS_BASE_EXC_SUBCLASS
.. c:macro:: Py_TPFLAGS_TYPE_SUBCLASS

These flags are used by functions such as
These flags are used by functions such as :c:func:`PyType_FastSubclass` and
:c:func:`PyLong_Check` to quickly determine if a type is a subclass
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated
of a built-in type; such specific checks are faster than a generic
check, like :c:func:`PyObject_IsInstance`. Custom types that inherit
Expand Down
Loading