I noticed a straight behaviour when I loop over multiple iterators in Python
>>> from itertools import tee
>>> X,Y = tee(range(3))
>>> [(x,y) for x in X for y in Y]
[(0, 0), (0, 1), (0, 2)]
I expected it to behave identical as
>>> [(x,y) for x in range(3) for y in range(3)]
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)]
What am I missing? I thought tee
as supposed to return independent iterators..