"AK" == Andrew Koenig firstname.lastname@example.org writes:
Barry> Would it be useful to add to the interator "interface" a Barry> method which would retrieve the original iterable object?
AK> What if there isn't one?
Barry> The method would return None.
But then you can't rely on it. That is, if you want to write code that depends on the ability to retrieve the original iterable, you have to give up the ability for that code to work on generators, for example.
I'm not saying it's not a useful thing to have; I'm just saying it might not be as useful as it appears at first.