mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-134786: raise error if Py_TPFLAGS_MANAGED_WEAKREF or Py_TPFLAGS_MANAGED_DICT is used without Py_TPFLAGS_HAVE_GC set (#135863)
This commit is contained in:
parent
d12cbf2865
commit
da65f38a94
8 changed files with 72 additions and 2 deletions
|
|
@ -1260,7 +1260,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
|
|||
This bit indicates that instances of the class have a :attr:`~object.__dict__`
|
||||
attribute, and that the space for the dictionary is managed by the VM.
|
||||
|
||||
If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set.
|
||||
If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` must also be set.
|
||||
|
||||
The type traverse function must call :c:func:`PyObject_VisitManagedDict`
|
||||
and its clear function must call :c:func:`PyObject_ClearManagedDict`.
|
||||
|
|
@ -1278,6 +1278,8 @@ and :c:data:`PyType_Type` effectively act as defaults.)
|
|||
This bit indicates that instances of the class should be weakly
|
||||
referenceable.
|
||||
|
||||
If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` must also be set.
|
||||
|
||||
.. versionadded:: 3.12
|
||||
|
||||
**Inheritance:**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue