List comprehensions
Magnus L. Hetland
mlh at vier.idi.ntnu.no
Mon Dec 20 19:01:13 EST 1999
Dan Schmidt <dfan at harmonixmusic.com> writes:
> mlh at vier.idi.ntnu.no (Magnus L. Hetland) writes:
[...]
> You know, I'm only half kidding when I say that the syntax for that
> second type of loop should be
>
> P = [(x, y) for x in X while y in Y]
It's not that bad :)
However - it has a temporality to it that I don't think fits the
sentence... I think "for all xs in X and ys in Y, do something"
is quite standard english, yet "for all xs in X while ys in Y, do
something" sounds a bit silly...
--
Magnus
Lie
Hetland
More information about the Python-list
mailing list