[Python-Dev] Adding a conditional expression in Py3.0

Josiah Carlson jcarlson at uci.edu
Fri Sep 23 18:11:23 CEST 2005


Gareth McCaughan <gmccaughan at synaptics-uk.com> wrote:
[seems to have gone off list with a portion of the discussion]
> > The reason I like "a if b else c" is because it has the
> > most natural word order. In English,
> >    My dog is happy if he has a bone, else sad.
> > sounds much more natural than
> >    My dog is, if he has a bone, happy, else sad.
> 
> Neither sounds very natural to me; conditional
> expressions don't occur much in English. It's
> much more common to hear something like
> 
>     My dog is happy if he has a bone; otherwise he's sad.


Natural english wise, this also sounds natural:

    If my dog has a bone he's happy, otherwise he's sad.


But yeah, I'll use them regardless of the syntax, even if I have
preferences.

 - Josiah



More information about the Python-Dev mailing list