@@ -44,17 +44,17 @@ Identifiers are integers in the range 0 to 5 inclusive.
44
44
Registering and using tools
45
45
'''''''''''''''''''''''''''
46
46
47
- .. function :: use_tool_id(tool_id: int, name: str) -> None
47
+ .. function :: use_tool_id(tool_id: int, name: str, / ) -> None
48
48
49
49
Must be called before *tool_id * can be used.
50
50
*tool_id * must be in the range 0 to 5 inclusive.
51
51
Raises a :exc: `ValueError ` if *tool_id * is in use.
52
52
53
- .. function :: free_tool_id(tool_id: int) -> None
53
+ .. function :: free_tool_id(tool_id: int, / ) -> None
54
54
55
55
Should be called once a tool no longer requires *tool_id *.
56
56
57
- .. function :: get_tool(tool_id: int) -> str | None
57
+ .. function :: get_tool(tool_id: int, / ) -> str | None
58
58
59
59
Returns the name of the tool if *tool_id * is in use,
60
60
otherwise it returns ``None ``.
@@ -237,11 +237,11 @@ Setting events globally
237
237
238
238
Events can be controlled globally by modifying the set of events being monitored.
239
239
240
- .. function :: get_events(tool_id: int) -> int
240
+ .. function :: get_events(tool_id: int, / ) -> int
241
241
242
242
Returns the ``int `` representing all the active events.
243
243
244
- .. function :: set_events(tool_id: int, event_set: int)
244
+ .. function :: set_events(tool_id: int, event_set: int, /) -> None
245
245
246
246
Activates all events which are set in *event_set *.
247
247
Raises a :exc: `ValueError ` if *tool_id * is not in use.
@@ -253,11 +253,11 @@ Per code object events
253
253
254
254
Events can also be controlled on a per code object basis.
255
255
256
- .. function :: get_local_events(tool_id: int, code: CodeType) -> int
256
+ .. function :: get_local_events(tool_id: int, code: CodeType, / ) -> int
257
257
258
258
Returns all the local events for *code *
259
259
260
- .. function :: set_local_events(tool_id: int, code: CodeType, event_set: int)
260
+ .. function :: set_local_events(tool_id: int, code: CodeType, event_set: int, /) -> None
261
261
262
262
Activates all the local events for *code * which are set in *event_set *.
263
263
Raises a :exc: `ValueError ` if *tool_id * is not in use.
@@ -284,6 +284,11 @@ performance monitoring. For example, a program can be run under a
284
284
debugger with no overhead if the debugger disables all monitoring
285
285
except for a few breakpoints.
286
286
287
+ .. function :: restart_events() -> None
288
+
289
+ Enable all the events that were disabled by :data: `sys.monitoring.DISABLE `
290
+ for all tools.
291
+
287
292
288
293
.. _callbacks :
289
294
@@ -292,7 +297,7 @@ Registering callback functions
292
297
293
298
To register a callable for events call
294
299
295
- .. function :: register_callback(tool_id: int, event: int, func: Callable | None) -> Callable | None
300
+ .. function :: register_callback(tool_id: int, event: int, func: Callable | None, / ) -> Callable | None
296
301
297
302
Registers the callable *func * for the *event * with the given *tool_id *
298
303
0 commit comments