308 as a special case of 312 (was: Re: Pep 312 value)
Erik Max Francis
max at alcyone.com
Fri Feb 28 02:52:58 EST 2003
jerf at compy.attbi.com wrote:
> On Thu, 27 Feb 2003 20:10:23 -0800, Erik Max Francis wrote:
>
> > Yes, but you already have exactly this functionality, with lambda:
> > etc.
>
> Same for the ternary operator.
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. PEP 312 merely
seeks to shorten a previously existing syntax by exactly one keyword.
> PEP 312 suggests the addition of a short-circuiting operator *in
> general*.
It's not short circuiting in the sense of implicit lazy evaluation.
It's simply a shorthand for writing zero-argument lambdas.
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ Conversation is the enemy of good wine and food.
\__/ Alfred Hitchcock
Physics reference / http://www.alcyone.com/max/reference/physics/
A physics reference.
More information about the Python-list
mailing list