[Python-ideas] except expression

Jan Kaliszewski zuo at chopin.edu.pl
Wed Feb 19 01:19:49 CET 2014


18.02.2014 17:25, Paul Moore napisał:

> OTOH, there's still an argument for only allowing a single exception
> name in the syntax (an "identifier" rather than an "expression" in
> syntax terms). If you must catch multiple exceptions, give the
> relevant tuple a name.

I believe that at this point (what the exception spec would be
allowed to be: identifier?, tuple?, any expression?) the syntax should
be identical to the statement syntax (i.e.: any expression).

Less special cases to remember.

For the same reason, I believe that tuple expressions
("except (ValueError, TypeError)") should be obligatorily
enclosed with parens as long as they are obligatorily enclosed
with parens in the statement syntax (i.e., probably till Python 3.13
:)).

*j



More information about the Python-ideas mailing list