Update PEP 669 specification to return current callback object when registering a new callback. (#2246)
This commit is contained in:
parent
23bdcb5db3
commit
d927d9d4a6
|
@ -127,6 +127,8 @@ To register a callable for events call::
|
|||
|
||||
sys.monitoring.register_callback(event, func)
|
||||
|
||||
``register_callback`` returns the previously registered callback, or ``None``.
|
||||
|
||||
Functions can be unregistered by calling
|
||||
``sys.monitoring.register_callback(event, None)``.
|
||||
|
||||
|
@ -192,7 +194,7 @@ Attributes of the ``sys.monitoring`` namespace
|
|||
* ``def set_events(event_set: Event)->None``
|
||||
* ``def get_local_events(code: CodeType)->Event``
|
||||
* ``def set_local_events(code: CodeType, event_set: Event)->None``
|
||||
* ``def register_callback(event: Event, func: Callable)->None``
|
||||
* ``def register_callback(event: Event, func: Callable)->Optional[Callable]``
|
||||
* ``def insert_marker(code: CodeType, offset: Event, marker_id=0: range(256))->None``
|
||||
* ``def remove_marker(code: CodeType, offset: Event)->None``
|
||||
|
||||
|
|
Loading…
Reference in New Issue