I don't understand PEP 308.

Erik Max Francis max at alcyone.com
Thu Mar 13 18:53:44 EST 2003


Tetsuo wrote:

> So it's just syntactic sugar? I assumed it lets you do something new
> and
> cool, that's why I was confused.

Yes, although plenty of things in the language are "syntactic sugar" in
the sense of not being strictly required to make the language Turing
complete; that doesn't mean that they should be in the language.

> Nah, that can't be it... The PEP says that usually, the ternary is
> "emulated" in some ugly ways, which don't include the if-then
> statement.

Yes, the conditional operator can be emulated in several ways, which are
either concise but wrong or correct but unreadable.  People in the field
are doing this (as we've seen through the course of these threads), so
there is at least some demand for a conditional operator construct.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ The love we give away is the only love we keep.
\__/ Elbert Hubbard
    Kepler's laws / http://www.alcyone.com/max/physics/kepler/
 A proof of Kepler's laws.




More information about the Python-list mailing list