[Python-Dev] PEP 308: "then" "else" for deprecating "and" "or"
side effects
Christian Tismer
tismer@tismer.com
Sat, 15 Feb 2003 06:43:02 +0100
Lalo Martins wrote:
> 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"
Please stay up-to-date. There is no such proposal any
longer, although it reads much better to me than the
latest version, which is complete overkill for me.
"spraxelmaksel", if this is international for broken
syntax.
> 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
These reductions are always simple.
It isn't about semantics at all.
I simply refuse "a if b then c", for a simple
reason: Way too many languages *have* some kind of
spelled "if" which goes to the right. I don't want
Python to use a keyword so much differently, then
"a when b else c" looks pretty understandable to me,
also if you were confrontated wiht 25+ languages, before.
good night -- chris
--
Christian Tismer :^) <mailto:tismer@tismer.com>
Mission Impossible 5oftware : Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a : *Starship* http://starship.python.net/
14109 Berlin : PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34 home +49 30 802 86 56 pager +49 173 24 18 776
PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04
whom do you want to sponsor today? http://www.stackless.com/