3 ms·
Library authors can make their modules initialize lazily. It's additional code complexity, but it's probably worth it in certain cases. At one point, I was on a
by scaredginger 4y ago
Library authors can make their modules initialize lazily. It's additional code complexity, but it's probably worth it in certain cases. At one point, I was on a team developing a complex extension module that would take several seconds to import since it produced a gigantic shared lib. Sure, that probably could've been made more modular, but lazy initialization was easier.
https://docs.python.org/3/library/importlib.html#implementing-lazy-imports https://docs.python.org/3/library/importlib.html#implementin...