I discovered some unexpected behavior with the %reset command. After a reset, issuing an import appears to reinstate the previous module bindings, not perform a 'fresh' import of the module. As a result, any edits to the module since the previous import (or reload) and my current reset/import are not exposed and my .py and .pyc files are out of sync.
<br><br>Ex:<br>In[ ]: import mymod # builds mymod.pyc if necessary and imports<br>....use module....<br>....Edit mymod in emacs.<br>In[ ]: reload(mymod) # builds mymod.pyc and reloads<br>....Everything works. Expected Python behavior.
<br><br>In[ ]: reset # Resets the namespace except IO history. This is confirmed with a dir()<br>....Edit mymod in emacs.<br>In[ ]: import mymod # Adds mymod to the namespace, but DOES NOT build mymod.pyc.<br>.... #
mymod.py and mymod.pyc are now out of sync. Loaded cached bindings of the module?<br><br>In[ ]: reload(mymod) # builds mymod.pyc and reloads. Normal behavior.<br><br><br>The reset/import/reload trifecta works (or a full exit and restart of ipython), but is there a way to get reset to fully 'flush' my previous bindings?
<br><br><br>-- <br>Christopher Burns, Software Engineer<br>Computational Infrastructure for Research Labs<br>10 Giannini Hall, UC Berkeley<br>phone: 510.643.4014<br><a href="http://cirl.berkeley.edu/">http://cirl.berkeley.edu/
</a>