In python i tried to create a copy of my iterator with using assignment however it create a copy of iterator which reference to the original iterator itself. For instance:
my_list = [5, 4, 3,2]
first_it = iter(my_list)
second_it = first_it
print next(first_it ) #it will print 5
print next(second_it) #it will print 4
print next(first_it ) #it will print 3
As you see in the example first_it and second_it both refer to same iterator object. Is it possible to create a copy of iterator object which is not reference to the original object?
Note
This question is about how to creating a copy of iterator object by value. So don't mention for item in my_list:
like solutions.
Thanks in advance