On Fri, Feb 21, 2014 at 8:52 AM, Antoine Pitrou <solipsis@pitrou.net> wrote:
On Fri, 21 Feb 2014 14:15:59 +1100
Chris Angelico <rosuav@gmail.com> wrote:
>
> A number of functions and methods have parameters which will cause
> them to return a specified value instead of raising an exception.  The
> current system is ad-hoc and inconsistent, and requires that each
> function be individually written to have this functionality; not all
> support this.

While I sympathize with the motivation, I really don't like the end
result:

>     lst = [1, 2]
>     value = lst[2] except IndexError: "No value"

is too much of a break from the usual stylistic conventions, and looks
like several statements were stuffed on a single line.

In other words, the gain in concision is counterbalanced by a loss in
readability, a compromise which doesn't fit in Python's overall design
principles.

(compare with "with", which solves actual readability issues due to the
distance between the "try" and the "finally" clause, and also promotes
better resource management)

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.

I'm -1 with the current syntax, but it can go into the + range if a better syntax can be chosen.