Hello,
This is my first post on this forum, so I might not know all the customs, sorry for that.
My question is regarding _LazyModule
implementation in 3.13. It has a check that the current module hasn’t been substituted in sys.modules in the process of loading[1], however standard, eager imports don’t have such a check [2]. From reading the lazy loader and module implementation it doesn’t seem that this invariant is critical to lazy imports themselves. So this might be just a generic check to prevent multiple module objects existing for the same module name?
[1] cpython/Lib/importlib/util.py at 3.13 · python/cpython · GitHub
[2] I infer that the standard import system doesn’t have such check because cases like cryptography/src/cryptography/utils.py at main · pyca/cryptography · GitHub exist and seem to be working