I would like to iterate over an iterable object (let\'s say, a list) and leave at some point remembering the position where I left off to continue the next time an iterator
def get_next(iterator):
for item in iterator:
yield item
my_list_iterator = get_next(my_list)
for val in my_list_iterator:
do_stuff(val)
if some_condition:
break
do_stuff()
for val in my_list_iterator:
continue_doing_stuff(val)