list-display semantics?

jainweiwu parywu at seed.net.tw
Sun Jun 10 14:29:47 EDT 2001


Hi all:
I tried the one-line command in a interaction mode:
[x for x in [1, 2, 3], y for y in [4, 5, 6]]
and the result surprised me, that is:
[[1,2,3],[1,2,3],[1,2,3],9,9,9]
Who can explain the behavior?
Since I expected the result should be:
[[1,4],[1,5],[1,6],[2,4],...]
--
Pary All Rough Yet.
parywu at seed.net.tw





More information about the Python-list mailing list