Skip to content

Commit f346fc7

Browse files
authored
Fix type signatures for callback examples
1 parent 08735b2 commit f346fc7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Doc/library/sys.monitoring.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,15 +356,15 @@ Different events will provide the callback function with different arguments, as
356356

357357
* :monitoring-event:`PY_START` and :monitoring-event:`PY_RESUME`::
358358

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

361361
* :monitoring-event:`PY_RETURN` and :monitoring-event:`PY_YIELD`::
362362

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

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

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

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

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

383383
* :monitoring-event:`LINE`::
384384

385385
func(code: CodeType, line_number: int) -> DISABLE | Any
386386

387387
* :monitoring-event:`BRANCH_LEFT`, :monitoring-event:`BRANCH_RIGHT` and :monitoring-event:`JUMP`::
388388

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

391391
Note that the *destination_offset* is where the code will next execute.
392392

393393
* :monitoring-event:`INSTRUCTION`::
394394

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

0 commit comments

Comments
 (0)