Too much code - slicing

Seebs usenet-nospam at seebs.net
Thu Sep 23 18:01:04 CEST 2010


On 2010-09-23, Andreas Waldenburger <usenot at geekmail.INVALID> wrote:
> On 23 Sep 2010 03:54:52 GMT Seebs <usenet-nospam at seebs.net> wrote:
>> I don't generally like constructs where important structural
>> information comes late in the construct. [snip]

> I think that is precisely the reason that the elements of the list come
> *first* in the list comprehension expression. The foremost idea of list
> comprehensions is "build a list", while the idea of a for-loop is
> "iterate over something".

Interesting!  I tend to think of "building a list" as more like a for loop
than like a data item with a qualifier.  If the first word inside the
[] were "for", that would tell me that the list was going to have some kind
of looping or generating going on, while if it's an expression, especially
a complicated expression, I don't know that right away.

But I can see it making sense either way for the loop, just because of
the similarity to mathematical notation.

-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