In my module, I have a couple of functions that depend on an external module with a long startup time. How do I use LazyLoader
? If I have
import veggies
or
import veggies.brussels.sprouts
or
from veggies.brussels import sprouts
how would I replace those statements to use LazyLoader
such that the execution of the contents of the module are postponed until needed?
It is not immediately obvious from the documentation how to use it. There is no example, and nullege code search only comes up with the unit test included with Python itself.