8000 gh-93955: Use unbound methods for slot `__getattr__` and `__getattribute__` by Fidget-Spinner · Pull Request #93956 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-93955: Use unbound methods for slot __getattr__ and __getattribute__ #93956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix comment
  • Loading branch information
Fidget-Spinner committed Jun 17, 2022
commit 0e14cc7032478fd704af4f4be42560862d95bd29
6 changes: 3 additions & 3 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -7827,9 +7827,9 @@ slot_tp_getattr_hook(PyObject *self, PyObject *name)
Py_INCREF(getattr);
/* speed hack: we could use lookup_maybe, but that would resolve the
method fully for each attribute lookup for classes with
__getattr__, even when the attribute is present. So we use
_PyType_Lookup and create the method only when needed, with
call_attribute. */
__getattr__, even when self has the default __getattribute__
method. So we use _PyType_Lookup and create the method only when
needed, with call_attribute. */
getattribute = _PyType_Lookup(tp, &_Py_ID(__getattribute__));
if (getattribute == NULL ||
(Py_IS_TYPE(getattribute, &PyWrapperDescr_Type) &&
Expand Down
0