[issue36923] Implemented __str__ for zip and map objects

2019-05-15 Thread Serhiy Storchaka


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 
proposition exhausts it.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36923] Implemented __str__ for zip and map objects

2019-05-15 Thread SilentGhost


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: +SilentGhost
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36923] Implemented __str__ for zip and map objects

2019-05-15 Thread Augustin PROLONGEAU


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: 342556
nosy: AugPro
priority: normal
severity: normal
status: open
title: Implemented __str__ for zip and map objects
type: enhancement
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com