MCPcopy Index your code
hub / github.com/ipython/ipython / clear_main_mod_cache

Method clear_main_mod_cache

IPython/core/interactiveshell.py:1172–1191  ·  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

1170 return main_mod
1171
1172 def clear_main_mod_cache(self):
1173 """Clear the cache of main modules.
1174
1175 Mainly for use by utilities like %reset.
1176
1177 Examples
1178 --------
1179 In [15]: import IPython
1180
1181 In [16]: m = _ip.new_main_mod(IPython.__file__, 'IPython')
1182
1183 In [17]: len(_ip._main_mod_cache) > 0
1184 Out[17]: True
1185
1186 In [18]: _ip.clear_main_mod_cache()
1187
1188 In [19]: len(_ip._main_mod_cache) == 0
1189 Out[19]: True
1190 """
1191 self._main_mod_cache.clear()
1192
1193 #-------------------------------------------------------------------------
1194 # Things related to debugging

Callers 1

resetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected