mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
GH-93911: Specialize LOAD_ATTR
for custom __getattribute__
(GH-93988)
This commit is contained in:
parent
36517101dd
commit
7276ca25f5
11 changed files with 219 additions and 86 deletions
|
@ -787,6 +787,9 @@ pycore_init_builtins(PyThreadState *tstate)
|
|||
PyObject *list_append = _PyType_Lookup(&PyList_Type, &_Py_ID(append));
|
||||
assert(list_append);
|
||||
interp->callable_cache.list_append = list_append;
|
||||
PyObject *object__getattribute__ = _PyType_Lookup(&PyBaseObject_Type, &_Py_ID(__getattribute__));
|
||||
assert(object__getattribute__);
|
||||
interp->callable_cache.object__getattribute__ = object__getattribute__;
|
||||
|
||||
if (_PyBuiltins_AddExceptions(bimod) < 0) {
|
||||
return _PyStatus_ERR("failed to add exceptions to builtins");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue