Closed
Description
As I described here, lazy loading external modules can break modules silently, even to other libraries, in weird or unexpected ways. I imagine you're already aware of this.
Given that there doesn't appear to be any reliable solution to this, I think it would be useful to at least document this flaw, so users can at least notice when something like this happens.
To reproduce
import lazy_loader as lazy
plt = lazy.load('matplotlib.pyplot')
plt
# This code can be in an arbitrary module
import matplotlib
import matplotlib.pyplot
matplotlib.pyplot
Gives:
AttributeError: module 'matplotlib' has no attribute 'pyplot'
Metadata
Metadata
Assignees
Labels
No labels