Skip to content

Commit

Permalink
Update PEP 669 specification to return current callback object when r…
Browse files Browse the repository at this point in the history
…egistering a new callback. (#2246)
  • Loading branch information
markshannon authored Jan 17, 2022
1 parent 23bdcb5 commit d927d9d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pep-0669.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)``.

Expand Down Expand Up @@ -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``

Expand Down

0 comments on commit d927d9d

Please sign in to comment.