Message 404623 - Python tracker (original) (raw)
I ended up writing up more thoughts on this in the issue about package: https://bugs.python.org/issue45540#msg404619.
Users can call importlib.util.find_spec(), which is probably good enough to figure out how a module was originally imported. So I don't have any serious objections to making the spec the writable single-source-of-truth.
FWIW, I'd rather there were high-level helpers available as an alternative to the low-level practice of modifying module attrs. However, in this case it probably isn't frequent enough to make it worth it.