Ok. That's true. It's technically correct as phrased. I glossed over the "compared to" aspect. I still think it could be made more clear.

On Fri, May 15, 2020, 4:40 PM MRAB <python@mrabarnett.plus.com> wrote:
On 2020-05-15 20:36, David Mertz wrote:
> On Fri, May 15, 2020 at 12:55 PM Eric V. Smith <eric@trueblade.com
> <mailto:eric@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-leave@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/