Showing content from http://mail.python.org/pipermail/python-dev/attachments/20140221/a7b51f60/attachment.html below:
<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 21, 2014 at 8:52 AM, Antoine Pitrou <span dir="ltr"><<a href="mailto:solipsis@pitrou.net" target="_blank">solipsis@pitrou.net</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 Fri, 21 Feb 2014 14:15:59 +1100<br>
Chris Angelico <<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>> wrote:<br>
><br>
> A number of functions and methods have parameters which will cause<br>
> them to return a specified value instead of raising an exception. Â The<br>
> current system is ad-hoc and inconsistent, and requires that each<br>
> function be individually written to have this functionality; not all<br>
> support this.<br>
<br>
</div>While I sympathize with the motivation, I really don't like the end<br>
result:<br>
<div class=""><br>
> Â Â lst = [1, 2]<br>
> Â Â value = lst[2] except IndexError: "No value"<br>
<br>
</div>is too much of a break from the usual stylistic conventions, and looks<br>
like several statements were stuffed on a single line.<br>
<br>
In other words, the gain in concision is counterbalanced by a loss in<br>
readability, a compromise which doesn't fit in Python's overall design<br>
principles.<br>
<br>
(compare with "with", which solves actual readability issues due to the<br>
distance between the "try" and the "finally" clause, and also promotes<br>
better resource management)<br></blockquote><div><br></div><div>While I like the general concept, I agree that it looks too much like a crunched statement; the use of the colon is a non-starter for me. I'm sure I'm not the only one whose brain has been trained to view a colon in Python to mean "statement", period. This goes against that syntactic practice and just doesn't work for me.</div>
<div><br></div><div>I'm -1 with the current syntax, but it can go into the + range if a better syntax can be chosen.</div></div></div></div>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4