j: Next unread message
k: Previous unread message
j a: Jump to all threads
j l: Jump to MailingList overview
On Sat, 2006-03-18 at 19:32 +0100, Giovanni Bajo wrote:
+1 on the general idea, I just don't specifically like that "except:" is the "wrong" thing to do: part of the PEP352 idea was that people writing "except:" out of ignorance would still not cause their program to intercept KeyboardInterrupt, or StopIteration.
Unless this new proposal also includes changing the meaning of "except:" to "except Error".
It's worth debating. OT1H, it's a semantic different for Python 2.x (although +1 on the idea for Py3K). OTOH, I think people generally want to just catch errors and not all exceptions. Going along with that, maybe the interpreter should do something different when an Exception that's not an Error reaches the top (e.g. not print a traceback if KeyboardInterrupt is seen -- we usually just catch that, print "Interrupted" and exit).
Also, under this new proposal, we could even remove Exception from the builtins namespace in Py3k. It's almost always wrong to use it, and if you really really need it, it's spelled exceptions.Exception.
I'm not sure I'd go as far as hiding Exception, since I don't think the penalty is that great and it makes it easier to document.