File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -464,6 +464,24 @@ type objects) *must* have the :attr:`ob_size` field.
464464 :const: `Py_TPFLAGS_HAVE_VERSION_TAG `.
465465
466466
467+ .. data :: Py_TPFLAGS_LONG_SUBCLASS
468+ .. data :: Py_TPFLAGS_LIST_SUBCLASS
469+ .. data :: Py_TPFLAGS_TUPLE_SUBCLASS
470+ .. data :: Py_TPFLAGS_BYTES_SUBCLASS
471+ .. data :: Py_TPFLAGS_UNICODE_SUBCLASS
472+ .. data :: Py_TPFLAGS_DICT_SUBCLASS
473+ .. data :: Py_TPFLAGS_BASE_EXC_SUBCLASS
474+ .. data :: Py_TPFLAGS_TYPE_SUBCLASS
475+
476+ These flags are used by functions such as
477+ :c:func: `PyLong_Check ` to quickly determine if a type is a subclass
478+ of a built-in type; such specific checks are faster than a generic
479+ check, like :c:func: `PyObject_IsInstance `. Custom types that inherit
480+ from built-ins should have their :c:member: `~PyTypeObject.tp_flags `
481+ set appropriately, or the code that interacts with such types
482+ will behave differently depending on what kind of check is used.
483+
484+
467485 .. data :: Py_TPFLAGS_HAVE_FINALIZE
468486
469487 This bit is set when the :c:member: `~PyTypeObject.tp_finalize ` slot is present in the
You can’t perform that action at this time.
0 commit comments