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

Greg Ewing greg at cosc.canterbury.ac.nz
Thu Sep 16 03:46:52 CEST 2004

> Consider also this:
>    x and 4 or 5
> which is of course a common idiom to workaround the lack of an 
> if-then-else expression.

Actually, I hope it isn't common, because it's flawed.
It doesn't always work properly even with current
Python semantics.

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