PEP-308 a "simplicity-first" alternative

Tony Lownds tony-clpy at lownds.com
Wed Feb 12 05:06:20 CET 2003


holger krekel <pyth at devel.trillke.net> wrote in message news:<mailman.1044992059.13191.python-list at python.org>...
>Inspired by "do the simplest thing that can possibly work"
> i now think that 
> 
>         x and y else z
> 
> might just do it and avoid the need for a new construct.  
> It's a very minor change just for fixing the problem at hand.  
>

For this to be a minor change "else" would have to be a binary
operator:

x and y else z  <=>  (x and y) else z
 
After (x and y) is evaluated, the value is false when either x is
false, or when x is true and y is false. How is "else" meant to
distinguish the two falses?

-Tony




More information about the Python-list mailing list