[Python-Dev] Re: ANN: PEP 335: Overloadable Boolean Operators (original) (raw)
Greg Ewing greg at cosc.canterbury.ac.nz
Mon Sep 13 04:59:41 CEST 2004
- Previous message: [Python-Dev] Re: ANN: PEP 335: Overloadable Boolean Operators
- Next message: [Python-Dev] Re: ANN: PEP 335: Overloadable Boolean Operators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
For Numeric/Numarray, I think and1/or1 would be unnecessary. If that were true in general it would simplify the proposal signifigantly: and2/or2 could be renamed to and/or and and1/or1 could be dropped.
It's true that none of the use cases I put forward need and1/or1. But I was trying to think of the future and at least show how the general case could be accommodated.
Leaving out and1/or1 would make things simpler, but at the risk of someone coming up with a use case for them in the future, requiring yet another change. Wouldn't it be best to get things right from the beginning if possible?
Also, the simplification wouldn't be all that great. There would still be the need for two bytecodes per boolean operation to accommodate either short-circuiting or not. All that would be saved is testing for and calling the and1/or1 methods.
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] Re: ANN: PEP 335: Overloadable Boolean Operators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]