[Python-Dev] PEP 463: Exception-catching expressions

Chris Angelico rosuav at gmail.com
Fri Feb 28 04:46:48 CET 2014


On Fri, Feb 28, 2014 at 1:12 PM, Glenn Linderman <v+python at g.nevcal.com> wrote:
> Yes.  But the point is really the location of the (), sorry if my "nice
> extension" comment is throwing you off that track.

Ah! I see.

We touched on this syntax on -ideas, but at the time, the proposed
syntax didn't have parens around the outside. Either location will
solve most of the same problems (like precedence/associativity versus
multiple except clauses), but shrinking down to just the exception
list and default value makes it look very different. It looks like
what's inside should be an expression, which it isn't. What's the
advantage of this form? What's its key advantage over the
parens-around-the-whole-thing form?

ChrisA


More information about the Python-Dev mailing list