Serhiy Storchaka added the comment:
It will fail for infinite and very large iterables. It can cause performing
unexpected operations. Examples:
zip(itertools.count(), itertools.repeat(None))
zip(file1, file2)
In general, the repr of the iterator should not change it state. But your
SilentGhost added the comment:
This would exhaust the object, seems like a rather unfortunate side effect. I
don't think this suggestion has any chance of being accepted, do feel free to
take it to python-ideas to demonstrate that benefits outweigh the downsides.
--
nosy: +SilentGhos
New submission from Augustin PROLONGEAU :
I think this would help development a lot.
Below an example of how i would see the function written for zip:
def __str__(self):
return str((*self,))
# And for __repr__ function
def __repr__(self):
return f'zip{str(self)}'
--
messages: