diff options
author | Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> | 2022-08-17 19:37:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-17 12:37:07 +0100 |
commit | 7276ca25f5f1440aa4d025350d3de15141854dde (patch) | |
tree | 253f8e34893018705c9f04810d68e2d798c1bd24 /Python/pylifecycle.c | |
parent | 36517101dd80cae93da379e95e98a688c52935b7 (diff) | |
download | cpython-7276ca25f5f1440aa4d025350d3de15141854dde.tar.gz cpython-7276ca25f5f1440aa4d025350d3de15141854dde.zip |
GH-93911: Specialize `LOAD_ATTR` for custom `__getattribute__` (GH-93988)
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 11a45800533..bb646f1a0ee 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -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"); |