diff --git a/pep-0669.rst b/pep-0669.rst index a34cb311d..ebef129c5 100644 --- a/pep-0669.rst +++ b/pep-0669.rst @@ -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``