For review: PEP 308 - If-then-else expression
tismer at tismer.com
Mon Feb 10 01:09:06 CET 2003
Alex Martelli wrote:
> Georg Mischler wrote:
>>>We have an important precedent in Python, in the form of list
>>>comprehension, where `if' and `for' are appended to the expression.
>>And that's why I'm really glad that list comprehensions *require*
>>the [brackets] around them. They tell the reader that there is
>>something slightly unusual going on inside. In a way, list
>>comprehensions are a seperate language within the language.
Ok! Let's agree so far.
Comprehensions as a special language, indicated by
the list magic character "[". D'acor?
>>In contrast, the strange sequence of conditional and expressions
>>proposed in this PEP can almost appear anywhere in the code
>>without the slightest visual warning. That looks like very
>>dangerous territory to me.
[Alex jumping on the wagon]
> So maybe the syntax should be:
> [whentrue if condition else whenfalse]
> i.e., just like in the PEP *BUT* with brackets around it.
No no no no no no!
> Minus: the brackets suggest "list" and there's no list here.
:-)) righty righty right (naah, hear ?)
> Pluses: remove the "can almost appear anywhere", add the
> "tell the reader", exploit the "trailing if" habit from
> LC's -- the lack of any 'for' clause should be
> sufficient to distinguish this from LC's, I think.
Yeah, plus some tip of salt, Oregano, Estragon, /no/ garlic,
What is the taste, after all? ... Stinks, really, maybe???
LCs were digestible, with some effort, but digestible.
But what now. Using LCs to justify CEs? (brrrppps)!
I can eat this, but (brrpp), I have to say (brrp) ???
sallowing this as well is hardly standable. In this
context, the suffix expressions of LC's become
undigestible to me, again.
Alex, let's have some pasta and *many* beers instead
of this great new syntax that
/makes me want to wommit/*)
*) no accusion and by no means to you,
just a quote from "Harold and Maude"
Alex, help, they're going to take my heart away, away...
Christian Tismer :^) <mailto:tismer at 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/
More information about the Python-list