File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -67,3 +67,13 @@ as much as it can.
67
67
.. c :function :: PyObject* PyWeakref_GET_OBJECT (PyObject *ref)
68
68
69
69
Similar to :c:func: `PyWeakref_GetObject `, but does no error checking.
70
+
71
+
72
+ .. c :function :: void PyObject_ClearWeakRefs (PyObject *ob)
73
+
74
+ This function is called by the :c:member: `~PyTypeObject.tp_dealloc ` handler
75
+ to clear weak references.
76
+
77
+ This iterates through the weak references for *ob * and calls callbacks
78
+ for those references which have one. It returns when all callbacks have
79
+ been attempted.
Original file line number Diff line number Diff line change @@ -960,7 +960,7 @@ Porting to Python 3.12
960
960
Classes declaring :const: `Py_TPFLAGS_MANAGED_DICT ` should call
961
961
:c:func: `!_PyObject_VisitManagedDict ` and :c:func: `!_PyObject_ClearManagedDict `
962
962
to traverse and clear their instance's dictionaries.
963
- To clear weakrefs, call :c:func: `! PyObject_ClearWeakRefs `, as before.
963
+ To clear weakrefs, call :c:func: `PyObject_ClearWeakRefs `, as before.
964
964
965
965
* The :c:func: `PyUnicode_FSDecoder ` function no longer accepts bytes-like
966
966
paths, like :class: `bytearray ` and :class: `memoryview ` types: only the exact
You can’t perform that action at this time.
0 commit comments