@@ -352,19 +352,21 @@ Callback function arguments
352
352
that there are no arguments to the call.
353
353
354
354
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.
355
356
Different events will provide the callback function with different arguments, as follows:
356
357
357
358
* :monitoring-event: `PY_START ` and :monitoring-event: `PY_RESUME `::
358
359
359
- func(code: CodeType, instruction_offset: int) -> object # DISABLE | Any
360
+ func(code: CodeType, instruction_offset: int) -> object
360
361
361
362
* :monitoring-event: `PY_RETURN ` and :monitoring-event: `PY_YIELD `::
362
363
363
- func(code: CodeType, instruction_offset: int, retval: object) -> object # DISABLE | Any
364
+ func(code: CodeType, instruction_offset: int, retval: object) -> object
364
365
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)::
366
368
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
368
370
369
371
*code * represents the code object where the call is being made, while
370
372
*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
378
380
* :monitoring-event: `RAISE `, :monitoring-event: `RERAISE `, :monitoring-event: `EXCEPTION_HANDLED `,
379
381
:monitoring-event: `PY_UNWIND `, :monitoring-event: `PY_THROW ` and :monitoring-event: `STOP_ITERATION `::
380
382
381
- func(code: CodeType, instruction_offset: int, exception: BaseException) -> object # DISABLE | Any
383
+ func(code: CodeType, instruction_offset: int, exception: BaseException) -> object
382
384
383
385
* :monitoring-event: `LINE `::
384
386
385
- func(code: CodeType, line_number: int) -> DISABLE | Any
387
+ func(code: CodeType, line_number: int) -> object
386
388
387
389
* :monitoring-event: `BRANCH_LEFT `, :monitoring-event: `BRANCH_RIGHT ` and :monitoring-event: `JUMP `::
388
390
389
- func(code: CodeType, instruction_offset: int, destination_offset: int) -> object # DISABLE | Any
391
+ func(code: CodeType, instruction_offset: int, destination_offset: int) -> object
390
392
391
393
Note that the *destination_offset* is where the code will next execute.
392
394
393
395
* :monitoring-event: `INSTRUCTION `::
394
396
395
- func(code: CodeType, instruction_offset: int) -> object # DISABLE | Any
397
+ func(code: CodeType, instruction_offset: int) -> object
0 commit comments