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 @@ -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
19111917sysconfig
19121918---------
You can’t perform that action at this time.
0 commit comments