This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kaorihinata
Recipients brett.cannon, eric.smith, kaorihinata
Date 2021-03-14.02:05:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I've spent a bit of time building (and rebuilding) Python 3.9 with a modified `Lib/importlib/`/regenerated `importlib.h` to give me some extra logging, and believe the answer I was looking for is `_find_and_load_unlocked`. `_find_and_load_unlocked` appears to load the module in question, and always attach it to the parent regardless of the contents of `fromlist` (`_find_and_load_unlocked` isn't even aware of `fromlist`.) The only real condition seems to be "is there a parent/are we in a package?". `Lib/importlib/` is pretty sparsely documented so it's not immediately obvious whether or not some other piece of `importlib` depends on this behavior. If the author is known, then they may be able to give some insight into why the decision was made, and what the best solution would be?
Date User Action Args
2021-03-14 02:05:39kaorihinatasetrecipients: + kaorihinata, brett.cannon, eric.smith
2021-03-14 02:05:39kaorihinatasetmessageid: <>
2021-03-14 02:05:39kaorihinatalinkissue43477 messages
2021-03-14 02:05:39kaorihinatacreate