[Python-Dev] a quit that actually quits

"Martin v. Löwis" martin at v.loewis.de
Wed Dec 28 11:38:31 CET 2005


Fredrik Lundh wrote:
> any suggestions on how to improve this ?

Introducing sys.commandline is fine; overriding sys.excepthook
still worrisome.

What's wrong with triggering this in some __repr__ implementation?

If an excepthook must be installed, why couldn't the previous
excepthook be preserved, and called in case the exception is
not what you are looking for?
Of course, even if this excepthook behaves friendly, some other
package might overwrite excepthook without preserving yours,
in which case people would "sometimes" get a NameError when
they try to exit.

Regards,
Martin


More information about the Python-Dev mailing list