PEP 308: I liked the original proposal better

Andrew Bennetts andrew-pythonlist at puzzling.org
Fri Feb 14 00:17:01 EST 2003


On Fri, Feb 14, 2003 at 12:56:39PM +0800, Simon Wittber (Maptek) 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 against its use. Python is about about doing things the Right
> Way, not the common accepted way.

Sure, but the Python I know also tends to be about doing things the
Left-to-Right way ;)

-Andrew.






More information about the Python-list mailing list