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

jerf at compy.attbi.com jerf at compy.attbi.com
Fri Feb 28 00:01:27 EST 2003


On Thu, 27 Feb 2003 20:10:23 -0800, Erik Max Francis wrote:

> jerf at compy.attbi.com wrote: (stuff with two >>'s)
> Yes, but you already have exactly this functionality, with lambda: etc.

Same for the ternary operator.

Again, every argument against PEP312 applies to PEP308; this time you
used "You can already do this with current syntax if you want.", which I
failed to mention specifically.

>> Note, and I can't emphasize this enough, that **every** argument tha can
>> be brought to bear against 312 applies equally to the ternary operator.
> 
> No, I don't agree with that at all.  PEP 308 suggests the addition of a
> concise short-circuiting conditional operator, 

PEP 312 suggests the addition of a short-circuiting operator *in general*.

Also, I don't see how the subsequent stuff challenges my assertion that
every argument against 312 applies to 308. Again, "purely syntactic sugar"
applies equally strongly to X if C else Y and everything else; *none* of
this is new capability. It just reinforces my point.

> I really fail to see the advantage in removing the one keyword that sets
> the code apart ("Watch out, there is a thunk here!")

Brevity, since that's the whole point of 308. If it's so important it's
worth adding a new operator, it's importent enough to add something
actually flexible enough to be useful. If it's not a sufficient
justification for 312, it's even less of a justification for 308, which
doesn't even have the virtue of being powerful.




More information about the Python-list mailing list