-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
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
GH-115651: Convert LOAD_MODULE_ATTR
into LOAD_INLINE_CONST
when the module is itself a constant.
#115711
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.
Generally looks good, just one change requested. Thanks!
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.
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
.
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 I just have a few questions
…when the module is itself a constant. (pythonGH-115711)
…when the module is itself a constant. (pythonGH-115711)
…when the module is itself a constant. (pythonGH-115711)
Module attributes are global variables from other modules. It makes sense to convert them to constants as we already do for global variables.
LOAD_ATTR_MODULE
to a constant where the module is already a constant #115651