PEP308: Yet another syntax proposal

Aahz aahz at pythoncraft.com
Mon Feb 10 13:25:46 EST 2003


In article <eppstein-A7834B.09590110022003 at news.service.uci.edu>,
David Eppstein  <eppstein at ics.uci.edu> wrote:
>In article <b28on9$a3l$1 at panix2.panix.com>, aahz at pythoncraft.com (Aahz) 
>wrote:
>>
>> You're missing the point.  How frequently does this occur such that
>> getting all our knickers in a twist is worth it?  So far, most of the
>> examples pushing a conditional expression have *NOT* required
>> short-circut behavior.  For the cases where side-effects restrict the
>> use of a conditional expression, I think perhaps requiring the use of an
>> if statement is the most appropriate way to handle it.
>
>My feeling is that the reason for short circuiting isn't so much because 
>of side effects (I think we should try to keep expressions as free of 
>side effects as possible) but because one or both of the two sides may 
>be undefined and raise an exception if the guard condition is not met.

That's still not addressing my point: how often is short-circuit
evaluation needed?  That's the *only* reason to consider conditional
expressions rather than a new builtin conditional function.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Register for PyCon now!  http://www.python.org/pycon/reg.html




More information about the Python-list mailing list