[Python-Dev] Re: ANN: PEP 335: Overloadable Boolean Operators

Greg Ewing greg at cosc.canterbury.ac.nz
Thu Sep 16 04:01:29 CEST 2004


> It's not that you couldn't make numarrays short circuit. In the
> expression "a and b", if all the elements of a are false, then we
> can skip evaluating b. I'm just not sure that this is a good idea.

Whether it would be worth it would be application-dependent,
i.e. it would only help if pre-scanning all the elements of a
were cheaper enough than evaluating b. Probably not a good
idea to make it the default behaviour.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+


More information about the Python-Dev mailing list