[Python-Dev] Re: ANN: PEP 335: Overloadable Boolean Operators (original) (raw)
Greg Ewing greg at cosc.canterbury.ac.nz
Thu Sep 16 04:01:29 CEST 2004
- Previous message: [Python-Dev] Re: ANN: PEP 335: Overloadable Boolean Operators
- Next message: [Python-Dev] ANN: PEP 335: Overloadable Boolean Operators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 +--------------------------------------+
- Previous message: [Python-Dev] Re: ANN: PEP 335: Overloadable Boolean Operators
- Next message: [Python-Dev] ANN: PEP 335: Overloadable Boolean Operators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]