For review: PEP 308 - If-then-else expression

Alex Martelli aleax at aleax.it
Sun Feb 9 14:37:41 EST 2003


Aahz wrote:

> In article <r8ahfto4.fsf at morpheus.demon.co.uk>,
> Paul Moore  <gustav at morpheus.demon.co.uk> wrote:
>>
>>As a follow-on question - does anyone seriously feel that a
>>significant portion of c.l.p is likely to have its opinion swayed by
>>arguments made in this thread?
> 
> Not by arguments, no, but by ideas.  I believe that the swing voters are
> those who are mildly sympathetic to conditional expressions, but who
> find one or all of the various proposals abhorrent.  If someone can come

Hey, I'm a swing voter -- cool!

> up with a truly Pythonic idiom for conditional expressions, I believe
> it'll pass.  I suspect that my criteria are similar to many other
> people's:
> 
> * must have clear left-to-right or right-to-left meaning
> 
> * must look vaguely readable even when abused as the conditional for if
> statements

Me, I'd ALSO like it to be general enough to pick 1-of-N cases,
not just 1-of-2.  But somebody else included the further hard
constraint that in the 1-of-2 cases, the "when true" value
MUST come before the "when false" one, and that makes the only
proposal I liked,
    selector->(when0, when1, when2)
unacceptable.  Pity:-(.


Alex





More information about the Python-list mailing list