@@ -41,7 +41,6 @@ The following functions can be safely called before Python is initialized:
4141  * :c:func: `PyObject_SetArenaAllocator `
4242  * :c:func: `Py_SetProgramName `
4343  * :c:func: `Py_SetPythonHome `
44-   * :c:func: `PySys_ResetWarnOptions `
4544  * the configuration functions covered in :ref: `init-config `
4645
4746* Informative functions:
@@ -2011,6 +2010,11 @@ Reference tracing
20112010   is set to :c:data:`PyRefTracer_DESTROY`). The **data** argument is the opaque pointer 
20122011   that was provided when :c:func:`PyRefTracer_SetTracer` was called. 
20132012
2013+    If a new tracing function is registered replacing the current a call to the 
2014+    trace function will be made with the object set to **NULL** and **event** set to 
2015+    :c:data:`PyRefTracer_TRACKER_REMOVED`. This will happen just before the new 
2016+    function is registered. 
2017+ 
20142018.. versionadded:: 3.13 
20152019
20162020.. c:var:: int PyRefTracer_CREATE 
@@ -2023,6 +2027,13 @@ Reference tracing
20232027   The value for the *event* parameter to :c:type:`PyRefTracer` functions when a Python 
20242028   object has been destroyed. 
20252029
2030+ .. c:var:: int PyRefTracer_TRACKER_REMOVED 
2031+ 
2032+    The value for the *event* parameter to :c:type:`PyRefTracer` functions when the 
2033+    current tracer is about to be replaced by a new one. 
2034+ 
2035+    .. versionadded:: 3.14 
2036+ 
20262037.. c:function:: int PyRefTracer_SetTracer(PyRefTracer tracer, void *data) 
20272038
20282039   Register a reference tracer function. The function will be called when a new 
@@ -2038,6 +2049,10 @@ Reference tracing
20382049
20392050   There must be an :term:`attached thread state` when calling this function. 
20402051
2052+    If another tracer function was already registered, the old function will be 
2053+    called with **event** set to :c:data:`PyRefTracer_TRACKER_REMOVED` just before 
2054+    the new function is registered. 
2055+ 
20412056.. versionadded:: 3.13 
20422057
20432058.. c:function:: PyRefTracer PyRefTracer_GetTracer(void** data) 
0 commit comments