On 2020-05-15 20:36, David Mertz wrote:
On Fri, May 15, 2020 at 12:55 PM Eric V. Smith <e...@trueblade.com <mailto:e...@trueblade.com>> wrote:

    Also: The PEP says "At most one additional item may be consumed from
    one of the iterators when compared to normal zip usage." I think
    this should be prefaced with "If ValueError is raised ...". Also,
    why does it say "at most one additional item". How could it ever be
    less than one?


This struck me as strange also.  I mean, the wording can be improved to clarify "if error."

But more significantly, it seems like it cannot conceivably be true.  If might be "At most one additional item from EACH of the iterators."

If I do zip_strict(a, b, c, d, e) and "e" is the one that is shorter, how could any algorithm ever avoid consuming one extra item of a, b, c, and d each?!

Well, it does say "when compared to normal zip usage".

The normal zip would consume an item of a, b, c, and d. If e is exhausted, then zip would just stop, but zip_strict would raise ValueError. There would be no difference in the number of items consumed but not used.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/5B26LEJYDRIFCP3ETEAWLJJFV76PUKQ4/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to