Project organization and import redux

Hamilton, William whamil1 at entergy.com
Thu Apr 5 17:42:43 CEST 2007


I apologize for bringing up something that's a month dead.  But, I've
been reading through the recent archives and came across this
discussion, and want to make sure I understand a particular about the
interactive prompt.

"Martin Unsal" <martinunsal at gmail.com> wrote:
> I'm perfectly well aware that I'm not going to be able to reload a
> widget in the middle of a running GUI app, for example. I'm not
> looking for gotcha free, I'll settle for minimally useful.
>
> Here's an analogy. In C, you can do an incremental build and run your
> modified application without having to first reboot your computer. In
> Python, where reload() is essentially the incremental build process,
> and the interpreter is essentially a virtual machine, you guys are
> saying that my best option is to just "reboot" the virtual machine to
> make sure I have a "clean slate". It may be the path of least
> resistance, but to say that it is necessary or inevitable is 1960s
> mainframe thinking.

Yes, the interpreter is a virtual machine.  But the interactive prompt
is not a command line in that virtual machine.  Instead, it is the
statement that is about to be executed by a program running in that
virtual machine.  When you type a statement and press enter, that
statement is executed as the next line of the program.  It's analogous
to using a debugger to step through a C program line by line, except
you're providing those lines immediately rather than having to write and
compile them in advance.  

Restarting the interactive prompt isn't like rebooting the computer;
it's just restarting a program that is running on the computer.  At
worst, the interpreter is a computer that automatically shuts down when
the program running on it ends.


Is this a valid understanding of the workings of the interactive prompt,
or am I way off base?


---
-Bill Hamilton
whamil1 at entergy.com
 




More information about the Python-list mailing list