For review: PEP 308 - If-then-else expression
adalke at mindspring.com
Mon Feb 10 07:09:43 CET 2003
> holger> Maybe Roman Suzi (IIRC) has found one (short-circuiting)
> holger> cond -> (true_expr, false_expr)
> holger> which i am currently thinking about.
> I'm not thrilled about this example because if you cover up the
> "cond ->" part, you get what looks like a tuple, and tuples don't
Still against the idea, but what about
cond -> true_expr else false_expr
? Reads in the right order, the -> can be recognized by the
parser, "else" already exists, and you can figure the context
given any two terms, that is,
are all obviously part of an if/else expression and nothing else.
dalke at dalkescientific.com
More information about the Python-list