PEP-308 a "simplicity-first" alternative
Erik Max Francis
max at alcyone.com
Tue Feb 11 23:18:20 EST 2003
Nick Vargish wrote:
> holger krekel <pyth at devel.trillke.net> writes:
>
> > Also it's nice that if you discover you don't need an else-part
> > anymore you can just delete it. With the other proposals you have
> > to rewrite your expression - using another idiom.
>
> Okay, this is indeed elegant. I'm in the and/else camp now, despite
> having come out for 'then/else' originally.
I'm not sure why that made the difference for you. Why does `C and x'
having some semantics make `C and x else y' a better contender? It's
just an equally-unreadable, idiomatic (but not broken) alternative to `C
and x or y'.
if C: x else: y
if C then x else y
C then x else y
and the like have the benefit of being immediately comprehensible to
anyone who comes across them, as well as reading left-to-right.
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ The multitude of books is making us ignorant.
\__/ Voltaire
EmPy / http://www.alcyone.com/pyos/empy/
A templating system for Python.
More information about the Python-list
mailing list