Skip to content

bpo-45219: Factor dictkey indexing #28389

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 5 commits into from
Sep 17, 2021

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Sep 16, 2021

Provides a better interface for querying dictkey objects and uses it specialize.c.

We will need this improved interface for future optimizations of object layout, so we might as well add it now.

Also fixes a super-obscure bug. If a globals dictionary contained a mutable key (your not supposed to, but the VM cannot prevent it), then a specialized LOAD_GLOBAL would not see the change in behavior when the key mutated.

https://bugs.python.org/issue45219

Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This LGTM. I just have some stylistic suggestions.

@markshannon markshannon merged commit 064464f into python:main Sep 17, 2021
niyas-sait pushed a commit to niyas-sait/cpython that referenced this pull request Sep 21, 2021
@markshannon markshannon deleted the factor-dictkey-indexing branch January 6, 2022 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants