308 as a special case of 312 (was: Re: Pep 312 value)

Paul Boddie paul at boddie.net
Fri Feb 28 08:04:11 EST 2003


Erik Max Francis <max at alcyone.com> wrote in message news:<3E5F155A.1EB376AA at alcyone.com>...
> 
> No, it's not the same.  The functionality of a conditional operator is
> possible in Python only with great awkwardness, defeating the purpose
> for using a conditional operator in the first place.

Yes, but the wider issue is: do we need a conditional operator at all?
It's not as if the conditional operator opens up completely new areas
of previously-impossible stuff - instead it just makes some things,
under certain specific circumstances, more convenient. The assumption
seems to have been that people can't do without such an operator, but
if the only tool in your toolbox is a hammer...

> PEP 312 merely seeks to shorten a previously existing syntax by exactly one
> keyword.

That's why it appears even more frivolous than PEP 308.

Paul

P.S. See also: http://www.python.org/search/hypermail/python-1993/0273.html
     Is this "The Ternary Operator Tenth Anniversary Debate" or what?




More information about the Python-list mailing list