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

Andrew Koenig ark at
Sat Feb 8 15:30:05 CET 2003

Erik> That's exactly my view, as well.  I would prefer `if p then x
Erik> else y', but if an extra keyword is absolutely contradindicated,
Erik> then I'll settle for `x if p else y'.  I just want the
Erik> functionality, I can learn to use the syntax.

I find one aspect of this discussion particularly interesting:

Most of the people in favor of PEP 308 have a pretty good idea of the
contexts in which they want to use conditional expressions.

Most of the people opposed to PEP 308 are giving purely subjective
reasons, disliking the whole idea so much that not only do they not
want to use it, but they want to prevent other people from doing so as

I've seen conflicts like this in other contexts; they're often a
symptom of two subsets of the community that come from different
backgrounds and want to program in different styles.

The real question, then, is how much stylistic diversity the Python
community wants to allow.

Andrew Koenig, ark at,

More information about the Python-list mailing list