Skip to content

bpo-40137: Optimize _PyType_GetModuleByDef() loop - #25505

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:type_getmodulebyref4
Apr 21, 2021
Merged

bpo-40137: Optimize _PyType_GetModuleByDef() loop#25505
vstinner merged 1 commit into
python:masterfrom
vstinner:type_getmodulebyref4

Conversation

@vstinner

@vstinnervstinner commented Apr 21, 2021

Copy link
Copy Markdown
Member

PyType_Ready() now ensures that a type MRO cannot be empty.

_PyType_GetModuleByDef() no longer checks "i < PyTuple_GET_SIZE(mro)"
at the first loop iteration to optimize the most common case, when
the argument is the defining class.

https://bugs.python.org/issue40137

PyType_Ready() now ensures that a type MRO cannot be empty.
_PyType_GetModuleByDef() no longer checks "i < PyTuple_GET_SIZE(mro)"
at the first loop iteration to optimize the most common case, when
the argument is the defining class.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@vstinner@the-knights-who-say-ni@bedevere-bot