2 ms·
> To do that on a module, you have to first import that module - and then all the imports at the top of it would've already run. Why not just replace the `__im
by yzmtf2008 6y ago
> To do that on a module, you have to first import that module - and then all the imports at the top of it would've already run.
Why not just replace the `__import__` function at program startup, when you haven't imported anything? Monkey patching `__import__` at any other time seems like a bad idea.