<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Feb 21, 2014 at 6:46 AM, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 22 February 2014 00:37, Eli Bendersky <<a href="mailto:eliben@gmail.com">eliben@gmail.com</a>> wrote:<br>


> This goes against anything I understand about how exceptions should and<br>
> should not be used.<br>
<br>
</div>I think you're thinking of a language that isn't Python - we use<br>
exceptions for control flow all over the place (it's how hasattr() is<br>
*defined*, for example).<br></blockquote></div><br></div><div class="gmail_extra">No, it is Python I'm thinking about. As I mentioned in the reply to Brett's message, I see a difference between allowing exceptions on expression level and statement level. The latter is less likely to be abused. Once you add exceptions into expressions, all bets are off.<br>

<br></div><div class="gmail_extra">For instance, it is sometime non-trivial to know which exceptions some function may throw. When you write a try...raise statement, you think hard about covering all the bases. In an expression you're unlikely to, which opens up a lot of possibilities for bugs. Again, please stop focusing just on the list[index] case -- the proposal adds a new significant feature to the language that can (and thus will) be used in a variety of scenarios.<br>

<br></div><div class="gmail_extra">Eli<br></div><div class="gmail_extra"><br><br></div></div>