On Sat, Feb 22, 2014 at 1:59 AM, Chris Angelico <ros...@gmail.com> wrote:
> I've spent the better part of the last hour debating this in my head.
> It's basically a question of simplicity versus future flexibility:
> either keep the syntax clean and deny the multiple-except-clause
> option, or mandate the parens and permit it. The first option has, in
> my own head, the stronger case - this is designed for simplicity, and
> it wouldn't be that big a deal to completely reject multiple except
> clauses and simply require that the

Oops, hit the wrong key and sent that half-written.

... and simply require that the statement form be used. But the
whelming opinion of python-dev seems to be in favour of the parens
anyway, and since they give us the possibility of future expansion
effectively for free, I've gone that way. Parens are now required; the
syntax is:

value = (expr except Exception: default)

and, as per genexp rules, redundant parens can be omitted:

print(lst[i] except IndexError: "Out of bounds")

ChrisA
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to