PEP 308: I liked the original proposal better

Mel Wilson mwilson at the-wire.com
Fri Feb 14 14:48:15 CET 2003


In article <mailman.1045198732.30827.python-list at python.org>,
"Simon Wittber (Maptek)" <Simon.Wittber at perth.maptek.com.au> wrote:
>
>Greg Ewing wrote:
>
>>I'd like to put in a plea for re-instatement of the original proposal
>>
>>    x if C else y
>>
>>which I found to be particularly elegant.
>
>I have to agree. From my point of view this is the most pythonic
>solution.
>
>Yes, the test is in the middle of the expression. The argument "This is
>not
>the way other languages do ternary expressions" is not a valid argument=20
>against its use. Python is about about doing things the Right Way, not
>the
>common accepted way.

a = interesting_result if assert_condition else exceptional_value

puts, or can put, the main payload first, and can round up
the nasty exceptions afterwards.  I liked it.

   Apparently enough people disliked it to have it removed
from the ballot before the vote.

        Regards.        Mel.




More information about the Python-list mailing list