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

Method clear_main_mod_cache

IPython/core/interactiveshell.py:1125–1145  ·  view source on GitHub ↗

Clear the cache of main modules. Mainly for use by utilities like %reset. Examples -------- In [15]: import IPython In [16]: m = _ip.new_main_mod(IPython.__file__, 'IPython') In [17]: len(_ip._main_mod_cache) > 0 Out[17]: True In

(self)

Source from the content-addressed store, hash-verified

1123 return main_mod
1124
1125 def clear_main_mod_cache(self):
1126 """Clear the cache of main modules.
1127
1128 Mainly for use by utilities like %reset.
1129
1130 Examples
1131 --------
1132
1133 In [15]: import IPython
1134
1135 In [16]: m = _ip.new_main_mod(IPython.__file__, 'IPython')
1136
1137 In [17]: len(_ip._main_mod_cache) > 0
1138 Out[17]: True
1139
1140 In [18]: _ip.clear_main_mod_cache()
1141
1142 In [19]: len(_ip._main_mod_cache) == 0
1143 Out[19]: True
1144 """
1145 self._main_mod_cache.clear()
1146
1147 #-------------------------------------------------------------------------
1148 # Things related to debugging

Callers 1

resetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected