On 2020-04-21 7:12 p.m., Steven D'Aprano wrote:
On Tue, Apr 21, 2020 at 05:33:24PM -0300, Soni L. wrote:

> 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.

I've seen it, as far as I can tell there are already good solutions
for getting a count out of an iterator.

are there *any* solutions for getting partial results out of zip with different-length iterators of unknown origin?

> 2. it'd help me clean up some of my code. :p

I don't see how it would clean up code rather than make it uglier. Can
you give an example?

> 3. I feel like it makes intuitive sense for zip to return a partial > result somehow, especially now that StopIteration and return work together.

With respect Soni, your intuitions do not have a good track record of
either being shared by other people, or of making good programming
features.

Maybe it's time for you to stop suggesting things that make "intuitive
sense" and start putting some careful, logical thought into the proposal
instead of going by intuition?




it makes intuitive sense that there'd be some way to get the iterator elements silently swallowed by zip against the wishes of the programmer. there isn't. so we avoid it because it's useless for anything more advanced than the "you've checked the lengths beforehand" use-case. I've recently posted my code on this list, something about a class LogAndCompare[1]. it's horrible. a bit of zip and it could be a bit nicer. but I need those partial results.

[1] https://creationix.github.io/http-clone/?https://soniex2.autistic.space/git-repos/abdl.git#cbdcd9dd71f3215520b40b0454cd21c03101bd33
_______________________________________________
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/Z7FRZPJQ33C7VIHO2KSD4B3IZPDGCRZ7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to