I was working on a project when I came into this really weird bug, and I have managed to cut it down to this:
xr = zip(range(0, 5), range(0, 5))
yr = zip(range(3, 4), range(0, 1))
print(list(xr), list(yr))
print(list(xr))
The expected output would be this:
[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)] [(3, 0)]
[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)]
Because I don't change xr or yr after I set them. I am just printing them as a list to the shell. But, when I actually run it, I get this output:
[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)] [(3, 0)]
[]
I have absolutely no clue why. I have been using python for about a week, and maybe this is supposed to happen, but I would appreciate it if someone told me what's going on here. Thanks!
My python version is Python 3.8.3