Expressions like `mod.attr`, where `mod` is a module, are in almost all cases effectively constants. We should optimize them as such. We already treat the `mod` as a constant, so it is a relatively simple step to treat `mod.attr` as a constant. <!-- gh-linked-prs --> ### Linked PRs * gh-115711 <!-- /gh-linked-prs -->
Expressions like
mod.attr, wheremodis a module, are in almost all cases effectively constants.We should optimize them as such.
We already treat the
modas a constant, so it is a relatively simple step to treatmod.attras a constant.Linked PRs
LOAD_MODULE_ATTRintoLOAD_INLINE_CONSTwhen the module is itself a constant. #115711