mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-116750: Add clear_tool_id function to unregister events and callbacks (#124568)
This commit is contained in:
parent
b482538523
commit
5e0abb4788
8 changed files with 165 additions and 8 deletions
|
@ -50,16 +50,14 @@ Registering and using tools
|
|||
*tool_id* must be in the range 0 to 5 inclusive.
|
||||
Raises a :exc:`ValueError` if *tool_id* is in use.
|
||||
|
||||
.. function:: clear_tool_id(tool_id: int, /) -> None
|
||||
|
||||
Unregister all events and callback functions associated with *tool_id*.
|
||||
|
||||
.. function:: free_tool_id(tool_id: int, /) -> None
|
||||
|
||||
Should be called once a tool no longer requires *tool_id*.
|
||||
|
||||
.. note::
|
||||
|
||||
:func:`free_tool_id` will not disable global or local events associated
|
||||
with *tool_id*, nor will it unregister any callback functions. This
|
||||
function is only intended to be used to notify the VM that the
|
||||
particular *tool_id* is no longer in use.
|
||||
Will call :func:`clear_tool_id` before releasing *tool_id*.
|
||||
|
||||
.. function:: get_tool(tool_id: int, /) -> str | None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue