
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~