On 05/14/2020 05:43 AM, Antoine Pitrou wrote:
On Wed, 13 May 2020 19:27:57 -0700
Ethan Furman <et...@stoneleaf.us> wrote:
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.
And how much do you think that costs, compared to the overall cost of
running the entire zip() function, including consumption of yielded
results by the calling frame?
I don't know. I saw zip being used in _pydecimal so I asked the question.
--
~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/QG6RTDYP7J6SP37AZGLYEYNQILCGSWCJ/
Code of Conduct: http://python.org/psf/codeofconduct/