@@ -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:
@@ -1835,6 +1834,10 @@ pointer and a void pointer argument.
18351834 called from the main interpreter. Each subinterpreter now has its own
18361835 list of scheduled calls.
18371836
1837+ .. versionchanged:: 3.12
1838+ This function now always schedules *func* to be run in the main
1839+ interpreter.
1840+
18381841.. _profiling:
18391842
18401843Profiling and Tracing
@@ -2011,6 +2014,11 @@ Reference tracing
20112014 is set to :c:data:`PyRefTracer_DESTROY`). The **data** argument is the opaque pointer
20122015 that was provided when :c:func:`PyRefTracer_SetTracer` was called.
20132016
2017+ If a new tracing function is registered replacing the current a call to the
2018+ trace function will be made with the object set to **NULL** and **event** set to
2019+ :c:data:`PyRefTracer_TRACKER_REMOVED`. This will happen just before the new
2020+ function is registered.
2021+
20142022.. versionadded:: 3.13
20152023
20162024.. c:var:: int PyRefTracer_CREATE
@@ -2023,6 +2031,13 @@ Reference tracing
20232031 The value for the *event* parameter to :c:type:`PyRefTracer` functions when a Python
20242032 object has been destroyed.
20252033
2034+ .. c:var:: int PyRefTracer_TRACKER_REMOVED
2035+
2036+ The value for the *event* parameter to :c:type:`PyRefTracer` functions when the
2037+ current tracer is about to be replaced by a new one.
2038+
2039+ .. versionadded:: 3.14
2040+
20262041.. c:function:: int PyRefTracer_SetTracer(PyRefTracer tracer, void *data)
20272042
20282043 Register a reference tracer function. The function will be called when a new
@@ -2038,6 +2053,10 @@ Reference tracing
20382053
20392054 There must be an :term:`attached thread state` when calling this function.
20402055
2056+ If another tracer function was already registered, the old function will be
2057+ called with **event** set to :c:data:`PyRefTracer_TRACKER_REMOVED` just before
2058+ the new function is registered.
2059+
20412060.. versionadded:: 3.13
20422061
20432062.. c:function:: PyRefTracer PyRefTracer_GetTracer(void** data)
0 commit comments