Martin v. Löwis wrote: > Introducing sys.commandline is fine; overriding sys.excepthook > still worrisome. > > What's wrong with triggering this in some __repr__ implementation?
because simple introspection may exit your program. unexpected exits are a lot more annoying than unexpected non-exits. > 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? this is done in site.py, before sitecustomize is loaded. I'm not sure how anyone else would be able to squeeze in an excepthook at this point, even if they wanted... > 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. sure, but people may sometimes get another result if they rebind exit (e.g. from sys import *), plug in a broken displayhook, or other- wise mess up their system. as long the documentation mentions how this works, and urges excepthook developers to be careful, I don't really see this as a problem. </F>
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com