For review: PEP 308 - If-then-else expression
Samuele Pedroni
pedronis at bluewin.ch
Sun Feb 9 23:44:28 EST 2003
From: "Erik Max Francis" <max at alcyone.com>
> Samuele Pedroni wrote:
>
> > statements are not expressions.
>
> Y'know, colons already can appear in expressions. Ever heard of
> lambdas?
I would not call lambda syntax felicitous and it's an heavyweight syntax.
My benchmark for what I would live with is:
_ and _ or _
substitute 'and' and 'or' with something appropriate and short.
Again the ternary short-circuiting cond op IMO should belong to the and/or
family.
> > For example the : in else: is absolutely spurious for the expression
> > case.
>
> It's not for the `if C:' portion, the alternative of which is to add an
> extra keyword (like `then'), which already has huge inertia pushing
> against it.
>
> if C: x else: y
>
> reads left-to-right, requires no new keywords or punctuation, is
> unambiguous, and is totally analogous to the if...else statement and
> thus is crystal clear.
thus it hurts my eyes.
More information about the Python-list
mailing list