[Pythonmac-SIG] can't exit module

Just van Rossum just@letterror.com
Mon, 11 Dec 2000 20:39:57 +0100


At 10:25 AM -0800 08-12-2000, Chris Barker wrote:
>ARRGG! once again, a problem arising from the fundamental flaw of the
>IDE: it uses the same interpreter to run itself as the scripts you are
>running.

Hm, funny how that never seems to bother me...

A new Python process on the Mac takes quite a bit of time: one of the fun
parts of a Python IDE is that code is executed instantly. You'd lose that
with a separate process. Another thing that's less convenient (if it's
possible at all) with a separate process is executing snippets of scripts
or modules. It saves a lot of time: you can reload individual functions and
methods, update module globals, update the behavior of live objects, etc.

Of course, a separate process is simply neccesary when you're dealing with
event loops. But unfortunately it is more difficult to implement than it
looks, and then there's the problem that _I_ don't really need it...

>This means that you are forced to have different behavior
>depending on whether a script is run from the IDE or not. This
>continually is causing problems like this one.

I don't even agree that sys.exit() should _ever_ exit the IDE: it is a
function to end a script. The IDE catches all exceptions, so also
SystemExit. Once thing that might be nice, would be for the IDE to not
throw a traceback window at you for SystemExit. This is what I do for
KeyboardInterrupt. On the other hand, you'd lose the SystemExit argument,
so I'm not sure this is ideal.

Just