-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
gh-117578: Introduce _PyType_GetModuleByDef2 private function #117661
Conversation
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Please don't change the documented behaviour of |
I can also revert the starting value of the loop from |
Co-authored-by: Petr Viktorin <encukou@gmail.com>
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, thank you!
As for tests, this should be covered by the decimal
test suite, but if you want to write a GetModuleByDef
test please ping me for a review.
|
@neonene: We should have measured the performance impact of this at the time, but it came up recently in conversation with @markshannon, so I decided to measure it. While overall on the benchmarking suite it's kind of inconclusive (1% faster, which is below the usual noise threshold), for the one benchmark that uses |
_PyType_GetModuleByDefInPairs
(provisional name: outdated) is a private function that takes two types, runsPyType_GetModuleByDef()
twice, and finally raises an error if any.