Too much code - slicing
Seebs
usenet-nospam at seebs.net
Sun Sep 19 19:30:32 EDT 2010
On 2010-09-19, MRAB <python at mrabarnett.plus.com> wrote:
> On 19/09/2010 22:32, Seebs wrote:
>> On 2010-09-19, AK<andrei.avk at gmail.com> wrote:
>>> Because that's what 'if' and 'else' mean.
>> My point is, I don't want the order of the clauses in if/else to change.
>> If it is sometimes "if<condition> <true-clause> else<false-clause>", then
>> it should *ALWAYS WITHOUT EXCEPTION* be condition first, then true clause,
>> then false clause. If it's sometimes "if condition true-clause else
>> false-clause", and sometimes "true-clause if condition else false-clause",
>> that's a source of extra complexity.
>
> [snip]
> Have you read PEP 308? There was a lot of discussion about it.
Interesting, in the historical section we see:
The original version of this PEP proposed the following syntax:
<expression1> if <condition> else <expression2>
The out-of-order arrangement was found to be too uncomfortable
for many of participants in the discussion; especially when
<expression1> is long, it's easy to miss the conditional while
skimming.
But apparently those objections were either unknown or disregarded when
the syntax was later adopted.
-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam at seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
More information about the Python-list
mailing list