Skip to content

GH-115651: Convert LOAD_MODULE_ATTR into LOAD_INLINE_CONST when the module is itself a constant. #115711

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 6 commits into from
Feb 22, 2024

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Feb 20, 2024

Module attributes are global variables from other modules. It makes sense to convert them to constants as we already do for global variables.

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.

Generally looks good, just one change requested. Thanks!

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

I have some clarity concerns (based on how long it took me to follow what's happening here) but the basics look good, other than (I think) a missing break.

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.

LGTM I just have a few questions

@markshannon markshannon merged commit b348313 into python:main Feb 22, 2024
@markshannon markshannon deleted the load-attr-module-const branch March 1, 2024 15:29
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this pull request Mar 4, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
LukasWoodtli pushed a commit to LukasWoodtli/cpython that referenced this pull request Jan 22, 2025
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.

3 participants