PEP308: Yet another syntax proposal

sismex01 at hebmex.com sismex01 at hebmex.com
Mon Feb 10 13:38:36 EST 2003


> From: aahz at pythoncraft.com [mailto:aahz at pythoncraft.com]
> Sent: Monday, February 10, 2003 12:26 PM
> 
> >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/

My question is "why leave it half-done?"

Why create a simple builtin function which doesn't do
short circuiting and then resort to half-baked hacks
when you do need it, when here's the chance to do it
fully and have a sanctioned short-circuiting ternary
operator, usable in all the cases the builtin would
work, and then some.

-gustavo





More information about the Python-list mailing list