30 Sep
2004
30 Sep
'04
2:19 p.m.
At 08:21 PM 9/30/04 +1000, Nick Coghlan wrote:
However, another possibility occurred to me:
try: # Do stuff except sys.special_exceptions: raise except: # Deal with all the mundane stuff
With an appropriately defined tuple, that makes it easy for people to "do the right thing" with regards to critical exceptions. Such a tuple could also be useful for invoking isinstance() and issubclass().
+1. This would be a big help for developers, if only in that it will tell us what exceptions we ought to do this with. IMO, this is probably important enough to make it a builtin; maybe call it CriticalExceptions or some such. Also, maybe in 2.5 we could begin warning about bare excepts that aren't preceded by non-bare exceptions.