On 8/31/06, Brett Cannon <[EMAIL PROTECTED]> wrote: > So this feels like the Perl idiom of using die: ``open(file) or die`` (or > something like that; I have never been a Perl guy so I could be off). > > > ... > > The problem I have with this whole proposal is that catching exceptions > should be very obvious in the source code. This proposal does not help with > that ideal. So I am -1 on the whole idea. > > -Brett
"Ouch" on the associated my idea with perl! Although I agree that it is good to be obvious about exceptions, there are some cases when they are simply less than exceptional. For example, you can do d.get(key, default) if you know something is a dictionary, but for general mappings you can't rely on that, and may often use exceptions as a kind of logic control. No, that doesn't sync with the purity of exceptions, but sometimes practicality and real-world usage trumps theory. Only allowing a single expression, it shouldn't be able to get ugly. Also, maybe I hate to admit it but it could allow 'expr1 except expr2' as pretty something more like the 'or die' paradigm. _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
