-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-46527: allow calling enumerate(iterable=...) again #30904
Conversation
As mentioned in the issue, this fixes a regression in 3.11. The regression was introduced in pythonGH-25154 (bpo-43706). There were already comments there about how this was too much code for a simple change. This makes it even worse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm Thanks for the fix
@JelleZijlstra |
Memory leak check done
|
I don't think my machine is great for benchmarking, but here's what I got. Branch:
Main:
So I guess I made it faster. |
Consider just reverting to the previous stable code. Vectorcall has little value in functions like enumerate() where the time loop of the input dominates the time for the initial call. |
Happy to do that if that's the consensus here. The code I added is rather complicated and probably not worth the maintenance overhead. |
@rhettinger @JelleZijlstra The reason I applied the vector call was that even if the enumerate complexity is increased, the implementation itself has not been changed a long time, so it has a low possibility of implementation changes in the future too. |
But I will agree with reverting the change if we thought that enumerate has the possibility of changes in the future, but adding a unit test itself looks valuable too. |
@rhettinger @JelleZijlstra So since no more regression is expected, I would like to propose merging the PR and once we need to change the implementation, we can revert Vectorcall anytime, Rollbacking Vectorcall will not raise any behavior regression so anytime we can rollback it. |
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I have made the requested changes; please review again |
Thanks for making the requested changes! @corona10: please review the changes made to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reflect nit change :)
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
As mentioned in the issue, this fixes a regression in 3.11.
The regression was introduced in GH-25154 (bpo-43706). There were already
comments there about how this was too much code for a simple change. This
makes it even worse. I'd be open to removing the vectorcall support instead.
https://bugs.python.org/issue46527