Skip to content

Commit 09c867d

Browse files
miss-islingtonOberon00nedbat
authored
[3.14] gh-116750: Document 3.14 changes around sys.monitoring.clear_tool_id (GH-156706) (#157481)
Co-authored-by: Christian Neumüller <christian+github@neumueller.me> Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
1 parent 3cc8df7 commit 09c867d

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

Doc/library/sys.monitoring.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,18 @@ Registering and using tools
5454

5555
Unregister all events and callback functions associated with *tool_id*.
5656

57+
.. versionadded:: 3.14
58+
5759
.. function:: free_tool_id(tool_id: int, /) -> None
5860

5961
Should be called once a tool no longer requires *tool_id*.
6062
Will call :func:`clear_tool_id` before releasing *tool_id*.
6163

64+
.. versionchanged:: 3.14
65+
Now calls :func:`clear_tool_id` before releasing *tool_id*.
66+
Previously, it would not disable global or local events associated
67+
with *tool_id*, nor unregister any callback functions.
68+
6269
.. function:: get_tool(tool_id: int, /) -> str | None
6370

6471
Returns the name of the tool if *tool_id* is in use,

Doc/whatsnew/3.14.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,6 +1907,12 @@ sys.monitoring
19071907
These replace and deprecate the :monitoring-event:`!BRANCH` event.
19081908
(Contributed by Mark Shannon in :gh:`122548`.)
19091909

1910+
* Add :func:`sys.monitoring.clear_tool_id` to unregister all events and
1911+
callback functions associated with a tool identifier.
1912+
:func:`sys.monitoring.free_tool_id` now calls it before releasing the
1913+
tool identifier, instead of leaving its events and callbacks registered.
1914+
(Contributed by Tian Gao in :gh:`116750`.)
1915+
19101916

19111917
sysconfig
19121918
---------

0 commit comments

Comments
 (0)