On 2020-04-21 12:48 p.m., Serhiy Storchaka wrote:
21.04.20 17:10, Soni L. пише:
I feel like zip could return partial results:
try:
next(zip([0], []))
except StopIteration as exc:
assert StopIteration.args == (0,)
how much would this break?
Why do you need this feature?
3 reasons:
1. see the other thread (strict zip), especially the parts where they
brought up the lack of peekable/unput iterators in the context of
getting a count out of an iterator.
2. it'd help me clean up some of my code. :p
3. I feel like it makes intuitive sense for zip to return a partial
result somehow, especially now that StopIteration and return work together.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/LKXZZEBXDBFFJ7K7MG6XPZYONQZYXRM5/
Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/4U7AILTPE2SVEEODGLRDTP7WWT5GS2S5/
Code of Conduct: http://python.org/psf/codeofconduct/