For review: PEP 308 - If-then-else expression
Andrew Koenig
ark at research.att.com
Fri Feb 7 15:57:50 EST 2003
Guido> Given that if-then-else expressions keep being requested, I
Guido> hereby put forward a proposal.
+0.8 on the proposal as it stands.
The reason for +0.8 and not +1 is that I would prefer a syntax
that doesn't evaluate right-to-left if someone can think of one.
However, list comprehensions already have similar anomalies
and they don't seem particularly bothersome.
I think this proposal is important because it significantly expands
what one can do straightforwardly in the functional domain. That is,
I consider it to be in the same general category as lambda and list
comprehensions -- features that not everyone will use, but that are
important to the people who use them.
My evidence that it is important is that (a) people keep asking for
it; (b) people keep thinking up circumlocutions to accomplish the
same thing; and (c) those circumlocutions are often either wrong
or hard to understand or remember.
--
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark
More information about the Python-list
mailing list