[Python-Dev] PEP 308: "then" "else" for deprecating "and" "or" side effects

Lalo Martins lalo@laranja.org
Fri, 14 Feb 2003 14:48:07 -0200


On Fri, Feb 14, 2003 at 04:17:17AM +0100, Christian Tismer wrote:
> 
>     arg = arg then 42 else "Default"
>     arg = arg else "Default"
>     arg = arg then 42

I feel the "then" above reads very funny; besides, as it isn't currently in
python, it means a new keyword.  Guido's proposal reads better, despite the
funny ordering:

arg = 42 if arg else "Default"

If you have an idea of how to disambiguate it, then we could augment his
with your binary ideas:

arg = arg else "Default"
arg = 42 if arg

[]s,
                                               |alo
                                               +----
--
            Those who trade freedom for security
               lose both and deserve neither.
--
http://www.laranja.org/                mailto:lalo@laranja.org
         pgp key: http://www.laranja.org/pessoal/pgp

Eu jogo RPG! (I play RPG)         http://www.eujogorpg.com.br/
GNU: never give up freedom                 http://www.gnu.org/