mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
gh-94673: Add Per-Interpreter tp_weaklist for Static Builtin Types (#95302)
* Store tp_weaklist on the interpreter state for static builtin types. * Factor out _PyStaticType_GET_WEAKREFS_LISTPTR(). * Add _PyStaticType_ClearWeakRefs(). * Add a comment about how _PyStaticType_ClearWeakRefs() loops. * Document the change. * Update Doc/whatsnew/3.12.rst * Fix a typo.
This commit is contained in:
parent
6e44bf9558
commit
3e7cad3bca
7 changed files with 59 additions and 1 deletions
|
|
@ -1942,6 +1942,13 @@ and :c:type:`PyType_Type` effectively act as defaults.)
|
|||
Weak reference list head, for weak references to this type object. Not
|
||||
inherited. Internal use only.
|
||||
|
||||
.. versionchanged:: 3.12
|
||||
|
||||
Internals detail: For the static builtin types this is always ``NULL``,
|
||||
even if weakrefs are added. Instead, the weakrefs for each are stored
|
||||
on ``PyInterpreterState``. Use the public C-API or the internal
|
||||
``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction.
|
||||
|
||||
**Inheritance:**
|
||||
|
||||
This field is not inherited.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue