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

Method __init__

IPython/core/displayhook.py:36–59  ·  view source on GitHub ↗
(self, shell=None, cache_size=1000, **kwargs)

Source from the content-addressed store, hash-verified

34 cull_fraction = Float(0.2)
35
36 def __init__(self, shell=None, cache_size=1000, **kwargs):
37 super(DisplayHook, self).__init__(shell=shell, **kwargs)
38 cache_size_min = 3
39 if cache_size <= 0:
40 self.do_full_cache = 0
41 cache_size = 0
42 elif cache_size < cache_size_min:
43 self.do_full_cache = 0
44 cache_size = 0
45 warn('caching was disabled (min value for cache size is %s).' %
46 cache_size_min,stacklevel=3)
47 else:
48 self.do_full_cache = 1
49
50 self.cache_size = cache_size
51
52 # we need a reference to the user-level namespace
53 self.shell = shell
54
55 self._,self.__,self.___ = '','',''
56
57 # these are deliberately global:
58 to_user_ns = {'_':self._,'__':self.__,'___':self.___}
59 self.shell.user_ns.update(to_user_ns)
60
61 @property
62 def prompt_count(self):

Callers

nothing calls this directly

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected