summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2022-08-05 01:26:59 (GMT)
committerGitHub <noreply@github.com>2022-08-05 01:26:59 (GMT)
commit87154d8dd890af0e847e91b06c71c741c08510d0 (patch)
treef85b1735e571bc110d0dac921ef0501c2daaefa0 /Doc/c-api
parente1182bc3776ea7cfdd3f82d5ba4fdfee40ae57ee (diff)
downloadcpython-87154d8dd890af0e847e91b06c71c741c08510d0.zip
cpython-87154d8dd890af0e847e91b06c71c741c08510d0.tar.gz
cpython-87154d8dd890af0e847e91b06c71c741c08510d0.tar.bz2
gh-94673: Add Per-Interpreter tp_subclasses for Static Builtin Types (gh-95301)
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/typeobj.rst14
1 files changed, 11 insertions, 3 deletions
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index 44884ac..3af48f4 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -135,7 +135,7 @@ Quick Reference
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
| [:c:member:`~PyTypeObject.tp_cache`] | :c:type:`PyObject` * | | | | |
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
- | [:c:member:`~PyTypeObject.tp_subclasses`] | :c:type:`PyObject` * | __subclasses__ | | | |
+ | [:c:member:`~PyTypeObject.tp_subclasses`] | void * | __subclasses__ | | | |
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
| [:c:member:`~PyTypeObject.tp_weaklist`] | :c:type:`PyObject` * | | | | |
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
@@ -1934,9 +1934,17 @@ and :c:type:`PyType_Type` effectively act as defaults.)
This field is not inherited.
-.. c:member:: PyObject* PyTypeObject.tp_subclasses
+.. c:member:: void* PyTypeObject.tp_subclasses
- List of weak references to subclasses. Internal use only.
+ A collection of subclasses. Internal use only. May be an invalid pointer.
+
+ To get a list of subclasses, call the Python method
+ :py:meth:`~class.__subclasses__`.
+
+ .. versionchanged:: 3.12
+
+ For some types, this field does not hold a valid :c:expr:`PyObject*`.
+ The type was changed to :c:expr:`void*` to indicate this.
**Inheritance:**