Good code patterns in Python

holger krekel pyth at devel.trillke.net
Wed Jul 2 09:43:33 EDT 2003


Bernhard Herzog wrote:
> Erik Max Francis <max at alcyone.com> writes:
> 
> >  The
> > complete solution to this would probably be a conditional expression,
> > e.g.:
> > 
> > 	variable = (if condition: someValue else: otherValue)
> > 
> > eliminating the duplication which can lead to errors.  (Python, of
> > course, doesn't have such a construct, and the silence after the
> > conditional expression PEP vote and the long silence thereafter suggests
> > that it never will.)
> 
> Guido broke his silence at EuroPython: The ternary operator will not be
> added to Python.

and there was great joy especially among the people who didn't find an
easy way to vote "no" :-)

Actually Guido made it pretty clear that he will be very careful about
adding language features especially at the syntax level. Moreover, for
Python-3 he plans to throw out some stuff like the string-module ...

cheers,

    holger





More information about the Python-list mailing list