MCPcopy Create free account
hub / github.com/ipython/ipython / __init__

Method __init__

IPython/core/events.py:29–40  ·  view source on GitHub ↗

Initialise the :class:`CallbackManager`. Parameters ---------- shell The :class:`~IPython.core.interactiveshell.InteractiveShell` instance available_callbacks An iterable of names for callback events.

(self, shell, available_events)

Source from the content-addressed store, hash-verified

27 This API is experimental in IPython 2.0, and may be revised in future versions.
28 """
29 def __init__(self, shell, available_events):
30 """Initialise the :class:`CallbackManager`.
31
32 Parameters
33 ----------
34 shell
35 The :class:`~IPython.core.interactiveshell.InteractiveShell` instance
36 available_callbacks
37 An iterable of names for callback events.
38 """
39 self.shell = shell
40 self.callbacks = {n:[] for n in available_events}
41
42 def register(self, event, function):
43 """Register a new event callback.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected