For review: PEP 308 - If-then-else expression

Christian Tismer tismer at tismer.com
Sun Feb 9 05:57:15 EST 2003


Dave Brueck wrote:
> On Sun, 9 Feb 2003, Christian Tismer wrote:
> 
> 
>>Dave Brueck wrote:
>>
>>>>listcomps are leading to "uncomprehensions". I would
>>>>like to see them dropped as a step in the wrong direction.
>>>
>>>Not me - when used properly they really add to the readability of my code.
>>>I'm glad we have 'em!
>>
>>"When used properly" applies to almost every construct.
> 
> 
> Obviously - I don't think anyone argues that. But it's simply your opinion
> that it lowers readability. IMO it raises it, that's all. Yay, we all have
> opinions.

Yes. And by expressing yours often enough, it will
outweight mine.

>>>>The proposed syntax is counterintuitive for me by two reasons:
>>>>
>>>>a) control flow in Python always involves special characters.
>>>>   It should at least have some markup at the start and end.
>>>
>>>That's part of the problem: you're thinking of control flow in the
>>>assembly-language sense and not in the Python sense.

I have no idea of "assembly language", what is it?
Python is the only language I know so far.
You must know, I'm very new to programming.

>>How is my thinking part of the problem, please?
> 
> 
> Because your original comment implied that if-expressions are for control
> flow. They are, but only at the lowest (bytecode or assembly language)
> level. In terms of program logic (what the developer is thinking about),
> if-expressions _aren't_ for control flow, in the normal sense of the term.

Please tell me how to become a developer.

>>>It has no special characters because (1) the keywords used have
>>>the saming meaning as always and (2) it's an expression, not a statement.
>>
>>Aha. So you propose to replace + - * / ** by keywords.
> 
> 
> What in the world are you talking about? The PEP uses 'if' and 'else' -
> keywords that already have well-understood meaning in Python, and their
> meaning is the same in all contexts. I have no idea how you get from that
> the idea that I want to replace other operators with keywords.

Please look at your statement from above: It says
"if something is an expression, then it uses keywords".
I was just kidding, obviously.

[more arguing about execution order]

> Ok - reread the last few paragraphs.

No, thanks. I know what you're saying.

> You said that reading and execution
> order should match as much as possible, I'm simply pointing out that in
> practice that happens far less often than you think, and it doesn't seem
> to cause people any problems. Most likely people read whole statements at
> a time anyway, so in practice I doubt there's much LtoR, RtoL reading
> going on anyway, and if there is it's in whole groups of tokens rather
> than individual ones.

There is no misunderstanding, just disagreement.

...

> The order of logic in the PEP isn't troubling: "use that door if it's
> open, otherwise use the back door" makes perfect sense. My perception is
> that some people react negatively to the proposed ordering more out of
> unfamiliarity than anything else - it doesn't take much effort to get
> accustomed to it.

Fine. My perception is that much more people are
not to dumb to get accustomed to that, but simply
don't like the extra syntax, different from almost
all conditional expressions in other languages,
for a very small to almost void gain in expressive
power.
If we were talking about a strong concept like
generators or new-style classes, it would be
worth it.
But this huge discussion about peanuts is so ridiculous
that I tried to make it even more ridiculous,
unfortunately with low success, yet.

cheers - chris

-- 
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 mailing list