Good code patterns in Python

Bernhard Herzog bh at intevation.de
Wed Jul 2 07:06:28 EDT 2003


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.

   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                           http://www.mapit.de/




More information about the Python-list mailing list