-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
gh-94808: Cover LOAD_GLOBAL
for custom dict subtypes
#96767
gh-94808: Cover LOAD_GLOBAL
for custom dict subtypes
#96767
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the contribution.
Lib/test/test_builtin.py
Outdated
def __getitem__(self, key): | ||
raise setonlyerror | ||
|
||
class customdict(dict): # this one should not do anything fancy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be defined just before the test that uses it (below). Ideally this function would be broken up - it's testing a lot of things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Thanks!
Thanks @sobolevn for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
…H-96767) (cherry picked from commit 044bcc1) Co-authored-by: Nikita Sobolev <[email protected]>
Sorry, @sobolevn and @iritkatriel, I could not cleanly backport this to |
GH-99091 is a backport of this pull request to the 3.11 branch. |
I've covered several missing conditions in
TARGET(LOAD_GLOBAL)
:globals()
dict subtype raises nonKeyError
:cpython/Python/ceval.c
Lines 2445 to 2447 in 53a54b7
__builtins__
dict subtype raises nonKeyError
:cpython/Python/ceval.c
Line 2458 in 53a54b7
NameError
in a custom__builtins__
dict subtype:cpython/Python/ceval.c
Lines 2453 to 2457 in 53a54b7