PEP 690: Lazy Imports Again

I totally agree with that and the with block idioms.

Not to have that use case :wink:. I think per-module flipping like this via a function call is too magical. If you need that level of control then you can manually change things as appropriate as you obviously control the code that will be affected (i.e. the module you are changing import semantics for). What you’re effectively doing is what a __future__ import typically does, so making a module have a side-effect due to importing a module (the exact thing you’re trying to get people not to do :wink:) seems weird.

4 Likes