Uh oh!
There was an error while loading. Please reload this page.
gh-117578: Introduce _PyType_GetModuleByDef2 private function - #117661
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Uh oh!
There was an error while loading. Please reload this page.
encukou
commented
Apr 23, 2024
Please don't change the documented behaviour of |
neonene
commented
Apr 23, 2024
I can also revert the starting value of the loop from |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
encukou
left a comment
There was a problem hiding this comment.
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.
bedevere-bot
commented
Apr 25, 2024
|
mdboom
commented
May 29, 2024
@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.