mnmelo / lazy_import

A module for lazy loading of Python modules
Other
86 stars 29 forks source link

Separate modules load simultaneously #22

Open mjo22 opened 3 years ago

mjo22 commented 3 years ago

In my _init_.py , I have two subpackages that I'm trying to lazy load.

lazy1 = lazy_import.lazy_module("mypkg.sub1") lazy2 = lazy_import.lazy_module("mypkg.sub2")

In an IDE when I go to load something from lazy1, it also loads lazy2. I would like them to lazily load separately. In each subpackage, I have an _init_.py where I do some relative imports. I'm seeing very odd behavior / crashing in this setup that I think would be fixed if the lazy imports would load separately. ``