On 8/31/06, Calvin Spealman <[EMAIL PROTECTED]> wrote:
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!

=)  The truth hurts.

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.

Practically most definitely beats purity, but I don't see the practicality of this over  what we already have.

Only allowing a single _expression_, it shouldn't be able to get ugly.

Famous last words.  Remember a big argument against the 'if' expressions was about them getting too unwieldly in terms of length and obscuring the fact that it is a conditional.  I have used 'if' expressions and they have been hard to keep very readable unless you are willing to use parentheses and make them unreadable.  I would be afraid of this happening here, but to an even more important construct that should always be easy to spot in source code.

-Brett
_______________________________________________
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

Reply via email to