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)
| 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 |