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

Simon Burton simonb at webone.com.au
Sat Feb 8 05:38:55 EST 2003


+1 from me.

after this:
"[ x for x in range(10) if is_special(x) ]",

to have this ternary construct:
"x if is_special(x) else y"

seems reasonable enough.

Perhaps the "else <expr2>" can default to "else None".

Simon Burton.





More information about the Python-list mailing list