Alternative suggestion for conditional expressions (see PEP 308)

Peter Hansen peter at engcorp.com
Thu Jul 15 17:15:39 CEST 2004


neblackcat wrote:

> Would anyone like to comment on the following idea?
>     Implement C-like conditional expressions, but in a more
>     flexible and "Python-like" way.
[...]
>     I therefore suggest a variation on the above
>     syntax such as:
> 
>     sColorName = ?("Black","White")[Color == COLOR_WHITE]

Funky uses of punctuation are about as non-Pythonic as you
can get, so I doubt this idea would make it past the post...

-Peter



More information about the Python-list mailing list