Succinctly wrap a list in a callable that returns each list element in order for each successive call
I feel like I must be missing something obvious, but I can’t seem to find a succinct way of creating a a callable that returns elements of a list in order for each call. E.g. In [1]: class CallableList: …: def __init__(self, list_): …: self.list = list_ …: self.pos = -1 …: def __call__(self): …:… Read More Succinctly wrap a list in a callable that returns each list element in order for each successive call