Another conditional expression candidate (PEP 308)

Erik Max Francis max at alcyone.com
Sun Feb 9 21:08:53 EST 2003


Roy Smith wrote:

> If "else: pass" isn't required in the statement, why should "else:
> None"
> be required in the expression?

Because in the statement form, the default "else" portion is to do
nothing whatsoever.  In the expression, it can't do nothing; it has to
do something.  I agree that if you _do_ want to make the "else" portion
optional, None is the logical choice, but I don't see the pressing need
for it to be optional in the first place.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Patiently, I'm still / Holding out until
\__/ Sandra St. Victor
    Church / http://www.alcyone.com/pyos/church/
 A lambda calculus explorer in Python.




More information about the Python-list mailing list