[Python-Dev] PEP308 alternative syntax: bool method

Aahz aahz@pythoncraft.com
Fri, 14 Feb 2003 11:50:29 -0500


On Fri, Feb 14, 2003, Mark Russell wrote:
>
> I know this subject has been beaten somewhat to death, but how about making
> the if/then/else operator a method of the bool type, as in:
> 
>     var = (x > 10).choose(ifyes, ifno)
> 
> Choose() would need to be a special function of course to avoid evaluating the
> non-selected choice.  I haven't seen this syntax proposed before, although I
> have not waded through all the debate in comp.lang.python.

Please do not clutter python-dev with any further discussion of PEP 308;
Guido explicitly asked all discussion to move to c.l.py.
-- 
Aahz (aahz@pythoncraft.com)           <*>         http://www.pythoncraft.com/

Register for PyCon now!  http://www.python.org/pycon/reg.html