For review: PEP 308 - If-then-else expression

Samuele Pedroni pedronis at bluewin.ch
Mon Feb 10 04:43:24 CET 2003


"Andrew Koenig" <ark at research.att.com> ha scritto nel messaggio
news:yu99of5klsvz.fsf at europa.research.att.com...
> Samuele> There are ~100 instances of that in the std lib code, see Tim
> Samuele> Peters post or the std lib directly, is for all to see.
>
> Right.  So all those uses give the impression that the (cond and x or y)
> technique works in all cases--which it doesn't.
>
> If (cond and x or y) always worked, I don't think I would care about
> introducing if-then-else expressions at all.

but _ and _ or _ sets also a benchmark for how much line-noisy a substitute
can be.

Otherwise people when x is always true would still use _ and x or _ .






More information about the Python-list mailing list