D
Dave Abrahams
Please consider:
[('a', 0), ('a', 1), ('a', 2)]
# Rewrite the same expression four different ways:
[('a', 0), ('a', 1), ('a', 2), ('b', 0), ('b', 1), ('b', 2), ('c', 0), ('c', 1), ('c', 2)]
[('a', 0), ('a', 1), ('a', 2), ('b', 0), ('b', 1), ('b', 2), ('c', 0), ('c', 1), ('c', 2)]
.... (('a',n) for n in range(3)),
.... (('b',n) for n in range(3)),
.... (('c',n) for n in range(3)) ))
[('a', 0), ('a', 1), ('a', 2), ('b', 0), ('b', 1), ('b', 2), ('c', 0), ('c', 1), ('c', 2)]
[('c', 0), ('c', 1), ('c', 2), ('c', 0), ('c', 1), ('c', 2), ('c', 0), ('c', 1), ('c', 2)]
Huh? Can anyone explain why the last result is different?
(This is with Python 2.6)
Thanks in advance!
[('a', 0), ('a', 1), ('a', 2)]
# Rewrite the same expression four different ways:
[('a', 0), ('a', 1), ('a', 2), ('b', 0), ('b', 1), ('b', 2), ('c', 0), ('c', 1), ('c', 2)]
[('a', 0), ('a', 1), ('a', 2), ('b', 0), ('b', 1), ('b', 2), ('c', 0), ('c', 1), ('c', 2)]
.... (('a',n) for n in range(3)),
.... (('b',n) for n in range(3)),
.... (('c',n) for n in range(3)) ))
[('a', 0), ('a', 1), ('a', 2), ('b', 0), ('b', 1), ('b', 2), ('c', 0), ('c', 1), ('c', 2)]
[('c', 0), ('c', 1), ('c', 2), ('c', 0), ('c', 1), ('c', 2), ('c', 0), ('c', 1), ('c', 2)]
Huh? Can anyone explain why the last result is different?
(This is with Python 2.6)
Thanks in advance!