<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 11, 2014 at 9:10 PM, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com" target="_blank">rosuav@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">PEP 463, Exception-catching expressions, is stable and I believe ready<br>
for pronouncement. Drumroll please...<br>
<br>
<a href="http://www.python.org/dev/peps/pep-0463/" target="_blank">http://www.python.org/dev/peps/pep-0463/</a><br>
<br>
PEP: 463<br>
Title: Exception-catching expressions<br>
Version: $Revision$<br>
Last-Modified: $Date$<br>
Author: Chris Angelico <<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>><br>
Status: Draft<br>
Type: Standards Track<br>
Content-Type: text/x-rst<br>
Created: 15-Feb-2014<br>
Python-Version: 3.5<br>
Post-History: 20-Feb-2014, 16-Feb-2014<br>
<br>
<br>
Abstract<br>
========<br>
<br>
Just as PEP 308 introduced a means of value-based conditions in an<br>
expression, this system allows exception-based conditions to be used<br>
as part of an expression.<br></blockquote><div><br></div><div>I want to reject this PEP. I think the proposed syntax is acceptable given the desired semantics, although it's still a bit jarring. It's probably no worse than the colon used with lambda (which echoes the colon used in a def just like the colon here echoes the one in a try/except) and definitely better than the alternatives listed.<br>
<br></div><div>But the thing I can't get behind are the motivation and rationale. I don't think that e.g. dict.get() would be unnecessary once we have except expressions, and I disagree with the position that EAFP is better than LBYL, or "generally recommended" by Python. (Where do you get that? From the same sources that are so obsessed with DRY they'd rather introduce a higher-order-function than repeat one line of code? :-)<br>
<br></div><div>This is probably the most you can get out of me as far as a pronouncement. Given that the language summit is coming up I'd be happy to dive deeper in my reasons for rejecting it there (if there's demand).<br>
<br>I do think that (apart from never explaining those dreadful acronyms :-) this was a well-written and well-researched PEP, and I think you've done a great job moderating the discussion, collecting objections, reviewing alternatives, and everything else that is required to turn a heated debate into a PEP. Well done Chris (and everyone who helped), and good luck with your next PEP!<br>
</div><div><br></div></div>-- <br>--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)
</div></div>