File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 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.
6767.. c :function :: PyObject* PyWeakref_GET_OBJECT (PyObject *ref)   
6868
6969   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
960960  Classes declaring :const: `Py_TPFLAGS_MANAGED_DICT ` should call
961961  :c:func: `!_PyObject_VisitManagedDict ` and :c:func: `!_PyObject_ClearManagedDict `
962962  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.
964964
965965* The :c:func: `PyUnicode_FSDecoder ` function no longer accepts bytes-like
966966  paths, like :class: `bytearray ` and :class: `memoryview ` types: only the exact
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments