Skip to content

Commit 0d53375

Browse files
authored
Tweak type annotations
1 parent 7360c23 commit 0d53375

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Doc/library/sys.monitoring.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -352,19 +352,21 @@ Callback function arguments
352352
that there are no arguments to the call.
353353

354354
When an active event occurs, the registered callback function is called.
355+
Callback functions returning any object other than :data:`DISABLE` will have no effect.
355356
Different events will provide the callback function with different arguments, as follows:
356357

357358
* :monitoring-event:`PY_START` and :monitoring-event:`PY_RESUME`::
358359

359-
func(code: CodeType, instruction_offset: int) -> object # DISABLE | Any
360+
func(code: CodeType, instruction_offset: int) -> object
360361

361362
* :monitoring-event:`PY_RETURN` and :monitoring-event:`PY_YIELD`::
362363

363-
func(code: CodeType, instruction_offset: int, retval: object) -> object # DISABLE | Any
364+
func(code: CodeType, instruction_offset: int, retval: object) -> object
364365

365-
* :monitoring-event:`CALL`, :monitoring-event:`C_RAISE` and :monitoring-event:`C_RETURN` (*arg0* can be :data:`MISSING`)::
366+
* :monitoring-event:`CALL`, :monitoring-event:`C_RAISE` and :monitoring-event:`C_RETURN`
367+
(*arg0* can be :data:`MISSING` specifically)::
366368

367-
func(code: CodeType, instruction_offset: int, callable: object, arg0: object) -> object # DISABLE | Any
369+
func(code: CodeType, instruction_offset: int, callable: object, arg0: object) -> object
368370

369371
*code* represents the code object where the call is being made, while
370372
*callable* is the object that is about to be called (and thus
@@ -378,18 +380,18 @@ Different events will provide the callback function with different arguments, as
378380
* :monitoring-event:`RAISE`, :monitoring-event:`RERAISE`, :monitoring-event:`EXCEPTION_HANDLED`,
379381
:monitoring-event:`PY_UNWIND`, :monitoring-event:`PY_THROW` and :monitoring-event:`STOP_ITERATION`::
380382

381-
func(code: CodeType, instruction_offset: int, exception: BaseException) -> object # DISABLE | Any
383+
func(code: CodeType, instruction_offset: int, exception: BaseException) -> object
382384

383385
* :monitoring-event:`LINE`::
384386

385-
func(code: CodeType, line_number: int) -> DISABLE | Any
387+
func(code: CodeType, line_number: int) -> object
386388

387389
* :monitoring-event:`BRANCH_LEFT`, :monitoring-event:`BRANCH_RIGHT` and :monitoring-event:`JUMP`::
388390

389-
func(code: CodeType, instruction_offset: int, destination_offset: int) -> object # DISABLE | Any
391+
func(code: CodeType, instruction_offset: int, destination_offset: int) -> object
390392

391393
Note that the *destination_offset* is where the code will next execute.
392394

393395
* :monitoring-event:`INSTRUCTION`::
394396

395-
func(code: CodeType, instruction_offset: int) -> object # DISABLE | Any
397+
func(code: CodeType, instruction_offset: int) -> object

0 commit comments

Comments
 (0)