mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
gh-103951: enable optimization for fast attribute access on module subclasses (GH-126264)
Co-authored-by: Nicolas Tessore <n.tessore@ucl.ac.uk>
This commit is contained in:
parent
3fecbe9255
commit
d9e251223e
5 changed files with 6 additions and 4 deletions
|
@ -1219,7 +1219,7 @@ _Py_Specialize_LoadAttr(_PyStackRef owner_st, _Py_CODEUNIT *instr, PyObject *nam
|
|||
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_OTHER);
|
||||
fail = true;
|
||||
}
|
||||
else if (PyModule_CheckExact(owner)) {
|
||||
else if (Py_TYPE(owner)->tp_getattro == PyModule_Type.tp_getattro) {
|
||||
fail = specialize_module_load_attr(owner, instr, name);
|
||||
}
|
||||
else if (PyType_Check(owner)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue