@@ -41,7 +41,6 @@ The following functions can be safely called before Python is initialized:
41
41
* :c:func: `PyObject_SetArenaAllocator `
42
42
* :c:func: `Py_SetProgramName `
43
43
* :c:func: `Py_SetPythonHome `
44
- * :c:func: `PySys_ResetWarnOptions `
45
44
* the configuration functions covered in :ref: `init-config `
46
45
47
46
* Informative functions:
@@ -2011,6 +2010,11 @@ Reference tracing
2011
2010
is set to :c:data:`PyRefTracer_DESTROY`). The **data** argument is the opaque pointer
2012
2011
that was provided when :c:func:`PyRefTracer_SetTracer` was called.
2013
2012
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
+
2014
2018
.. versionadded:: 3.13
2015
2019
2016
2020
.. c:var:: int PyRefTracer_CREATE
@@ -2023,6 +2027,13 @@ Reference tracing
2023
2027
The value for the *event* parameter to :c:type:`PyRefTracer` functions when a Python
2024
2028
object has been destroyed.
2025
2029
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
+
2026
2037
.. c:function:: int PyRefTracer_SetTracer(PyRefTracer tracer, void *data)
2027
2038
2028
2039
Register a reference tracer function. The function will be called when a new
@@ -2038,6 +2049,10 @@ Reference tracing
2038
2049
2039
2050
There must be an :term:`attached thread state` when calling this function.
2040
2051
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
+
2041
2056
.. versionadded:: 3.13
2042
2057
2043
2058
.. c:function:: PyRefTracer PyRefTracer_GetTracer(void** data)
0 commit comments