<br><br><div><span class="gmail_quote">On 8/31/06, <b class="gmail_sendername">Calvin Spealman</b> <<a href="mailto:ironfroggy@gmail.com">ironfroggy@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 8/31/06, Brett Cannon <<a href="mailto:brett@python.org">brett@python.org</a>> wrote:<br>> So this feels like the Perl idiom of using die: ``open(file) or die`` (or<br>> something like that; I have never been a Perl guy so I could be off).
<br>><br>> > ...<br>><br>> The problem I have with this whole proposal is that catching exceptions<br>> should be very obvious in the source code. This proposal does not help with<br>> that ideal. So I am -1 on the whole idea.
<br>><br>> -Brett<br><br>"Ouch" on the associated my idea with perl!</blockquote><div><br>=) The truth hurts. <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Although I agree that it is good to be obvious about exceptions, there<br>are some cases when they are simply less than exceptional. For<br>example, you can do d.get(key, default) if you know something is a<br>dictionary, but for general mappings you can't rely on that, and may
<br>often use exceptions as a kind of logic control. No, that doesn't sync<br>with the purity of exceptions, but sometimes practicality and<br>real-world usage trumps theory.</blockquote><div><br>Practically most definitely beats purity, but I don't see the practicality of this over what we already have.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Only allowing a single expression, it shouldn't be able to get ugly.</blockquote>
<div><br>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.
<br></div><br>-Brett<br></div>