I have a program like this:
if __name__=="__main__":
foo = expensiveDataProcessClass(filepath)
y = foo.doStuff()
y = foo.doOtherStuff()
I'm testing things out as a I build it in ipython with the %run myprogram command.
After it's running, since it takes forever, I'll break it with ctrl+C and go rewrite some stuff in the file.
Even after I break it, though, IPython has foo stored.
>type(foo)
__main__.expensiveDataProcessClass
I'm never having to edit anything in foo, so it would be cool if I could update my program to first check for the existence of this foo variable and just continue to use it in IPython rather than doing the whole creation process again.