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

Method __init__

IPython/core/display_trap.py:41–46  ·  view source on GitHub ↗
(self, hook=None)

Source from the content-addressed store, hash-verified

39 hook = Any()
40
41 def __init__(self, hook=None):
42 super(DisplayTrap, self).__init__(hook=hook, config=None)
43 self.old_hook = None
44 # We define this to track if a single BuiltinTrap is nested.
45 # Only turn off the trap when the outermost call to __exit__ is made.
46 self._nested_level = 0
47
48 def __enter__(self):
49 if self._nested_level == 0:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected