On 05/13/2020 06:04 AM, Antoine Pitrou wrote:
On Tue, 12 May 2020 11:36:38 -0700
Ethan Furman wrote:
Also, if a flag is used, won't that slow down every call to zip even when the
flag is False?
Why would it? Is that based on a rational analysis of how argument
parsing works?
Not the call itself, but the running of zip. Absent some clever programming it
seems to me that there are two choices if we have a flag:
- have two independent branches (basically `zip` and a `zip_strict` functions
inside `zip` itself) and have the flag select the branch; or
- have one branch which has extra logic that checks for at least one
StopIteration and at least one item in each iteration to see if it should raise.
If the first method is chosen then we may as well have two different functions;
if the second method is chosen that would seem to be a performance hit, even
when the flag is False.
--
~Ethan~
_______________________________________________
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/BXSBYTYSRNK3ZTWBDKPIGYDOMV2EPCDA/
Code of Conduct: http://python.org/psf/codeofconduct/