Visitar URL original
bpo-45219: Factor dictkey indexing by markshannon · Pull Request #28389 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20210918065229/https://github.com/python/cpython/pull/28389
Skip to content
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

bpo-45219: Factor dictkey indexing #28389

Merged
merged 5 commits into from Sep 17, 2021

Conversation

@markshannon
Copy link
Contributor

@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
Contributor

@Fidget-Spinner Fidget-Spinner left a comment

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

Objects/dictobject.c Show resolved Hide resolved
Python/specialize.c Outdated Show resolved Hide resolved
Objects/dictobject.c Outdated Show resolved Hide resolved
@markshannon markshannon merged commit 064464f into python:main Sep 17, 2021
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants