[Python-Dev] Adding C ternary select (a?b:c) to Python?

Eric S. Raymond esr@thyrsus.com
Mon, 31 Jan 2000 23:24:13 -0500


Ka-Ping Yee <ping@lfw.org>:
> Might as well summarize the other suggestions so far:
> 
>         return if x > 0: x else -x
>         return x > 0 ? x else -x

Mixing ? or : with a keyword is just *ugly*.  Yes, I know I said I wasn't
that interested in arguing syntax, but these make my gorge rise.
     
>         return x > 0 ? x : -x

I think the other suggestions are making this one look better.  At this
point I have to like either this or the algol68 style Guido mentioned.
-- 
		<a href="http://www.tuxedo.org/~esr">Eric S. Raymond</a>

The conclusion is thus inescapable that the history, concept, and 
wording of the second amendment to the Constitution of the United 
States, as well as its interpretation by every major commentator and 
court in the first half-century after its ratification, indicates 
that what is protected is an individual right of a private citizen 
to own and carry firearms in a peaceful manner.
         -- Report of the Subcommittee On The Constitution of the Committee On 
            The Judiciary, United States Senate, 97th Congress, second session 
            (February, 1982), SuDoc# Y4.J 89/2: Ar 5/5