PEP 308: I liked the original proposal better

Simon Wittber (Maptek) Simon.Wittber at perth.maptek.com.au
Thu Feb 13 23:56:39 EST 2003


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 
against its use. Python is about about doing things the Right Way, not
the
common accepted way.

This is what makes Python the great language it is.






More information about the Python-list mailing list