PEP308: Yet another syntax proposal

David Eppstein eppstein at ics.uci.edu
Mon Feb 10 12:59:01 EST 2003


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.

-- 
David Eppstein       UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/




More information about the Python-list mailing list