Message380694
In short, the module isn't being added to the package's namespace because we are directly modifying sys.modules (hence why the behaviour would be the same if we imported using `import foo.b` as `from foo import b`).
I personally prefer to use the metapath instead of modifying sys.modules but I agree that the given example should work when the lazy import is not in `__init__.py`. The other solution is to modify the `LazyLoader` class to explicitly add the lazy module to the package's namespace (opinions?). |
|
Date |
User |
Action |
Args |
2020-11-10 19:02:03 | epaine | set | recipients:
+ epaine, brett.cannon, ncoghlan, eric.snow, KevKeating |
2020-11-10 19:02:03 | epaine | set | messageid: <1605034923.56.0.0971596755176.issue42273@roundup.psfhosted.org> |
2020-11-10 19:02:03 | epaine | link | issue42273 messages |
2020-11-10 19:02:02 | epaine | create | |
|