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

Erik Max Francis max at
Sat Feb 8 04:43:20 CET 2003

"Steven D. Arnold" wrote:

> On 2/7/03 3:22 PM, "Gerrit Holl" <gerrit at> wrote:
> > IMHO, since else is obliged, 'x if a' is not allowed but 'x if a
> > else None'
> > is, which is not intuitive.
> I would agree here that "else" definitely should not be obligatory. 
> The
> "else None" should be implied if the else is missing.  "Explicit is
> better
> than implicit" is, I hope, a good rule of thumb rather than an
> absolute
> principle that trumps even intuitiveness and readability.

I read this, and I honestly don't understand which stance you're taking.
Are you saying that `x if a' should be legal and mean the same as `x if
a else None'?  You seem to invoke explicit-is-better-than-implicit
arguments which don't seem relevant either way here (to me, anyway).

 Erik Max Francis / max at /
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Shooters, looters / Now I got a laptop computer
\__/ Ice Cube
    Kepler's laws /
 A proof of Kepler's laws.

More information about the Python-list mailing list