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

Steven Bethard steven.bethard at gmail.com
Wed Sep 21 18:14:07 CEST 2005


Adam wrote:
> So looking at a few alternatives ...
>
[snip]
> (e ? (e1 ? a1 : b1) : (e2 ? a2 : b2))
>
[snip]
> (if e, (if e1, a1 else b1) else (if e2, a2 else b2))
>
[snip]
> (if e then (if e1 then a1 else b1) else (if e2 then a2 else b2))
>
[snip
> (e selects (e1 selects a1 else b1) else (e2 selects a2 else b2))
>
[snip]
> (e: (e1: a1 ? b1) ? (e2: a2 ? b2))
>
[snip]
> (e selects (e1 selects a1 ? b1) ? (e2 selects a2 ? b2))
>
[snip]
> (e selects (e1 selects a1, b1), (e2 selects a2, b2))
>

Please no more syntax proposals!  There were enough in the PEP.  It
looks like most people support a conditional expression of some sort. 
We need to leave the syntax to Guido.  We've already proved that like
the decorators discussions, we can't as a community agree on a syntax.
 That's what we have a BDFL for. =)

Steve
--
You can wordify anything if you just verb it.
        --- Bucky Katt, Get Fuzzy


More information about the Python-Dev mailing list