Good code patterns in Python

Bernhard Herzog bh at
Wed Jul 2 13:06:28 CEST 2003

Erik Max Francis <max at> 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.


Intevation GmbH                       

More information about the Python-list mailing list