[Python-ideas] except expression

Paul Moore p.f.moore at gmail.com
Wed Feb 19 08:53:07 CET 2014


On 19 February 2014 07:34, Chris Angelico <rosuav at gmail.com> wrote:
> Have you a preferred keyword-based proposal? Does it use an existing
> keyword or create a new one? The floor is yours, Paul: sell me your
> keyword :) Bear in mind, I used to be in favour of the "expr except
> Exception pass default" form, so it shouldn't be too hard to push me
> back to there.

Honestly? No, I don't. If I need an example of non-colon syntax I
choose "return" and consider "pass" because those are the 2 that seem
most reasonable, and I remember "return" fastest. But I can't really
argue strongly for them - whoever said it was right, *all* of the
keyword approaches are picking "something that's not awful" from what
we have.

My list of new keywords is basically the same as yours, but I don't
think the construct is important enough to warrant a new keyword (if
the if-expression couldn't justify "then", then we don't stand a
chance!)

So having struggled to find objections to the colon syntax, I've
reached a point where I think it's the best of the alternatives. "I
can't find a good enough objection" isn't exactly a ringing
endorsement, but it's the best I've got :-)

Paul


More information about the Python-ideas mailing list