File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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,
Original file line number Diff line number Diff line change @@ -1906,6 +1906,12 @@ sys.monitoring
19061906 These replace and deprecate the :monitoring-event: `!BRANCH ` event.
19071907 (Contributed by Mark Shannon in :gh: `122548 `.)
19081908
1909+ * Add :func: `sys.monitoring.clear_tool_id ` to unregister all events and
1910+ callback functions associated with a tool identifier.
1911+ :func: `sys.monitoring.free_tool_id ` now calls it before releasing the
1912+ tool identifier, instead of leaving its events and callbacks registered.
1913+ (Contributed by Tian Gao in :gh: `116750 `.)
1914+
19091915
19101916sysconfig
19111917---------
You can’t perform that action at this time.
0 commit comments