π― Available Demo Module
A special lazy_demo package is included in this demo. It contains submodules
that print messages when imported, making it easy to see when lazy imports are reified:
lazy_demo- Main package (prints "π¦ lazy_demo package loaded!")lazy_demo.heavy- Heavy computation module (prints "βοΈ lazy_demo.heavy loaded!")lazy_demo.utils- Utility functions (prints "π§ lazy_demo.utils loaded!")lazy_demo.data- Data module (prints "π lazy_demo.data loaded!")lazy_demo.broken- Demonstrates deferred error handling: imports successfully but has a function that triggers a lazy import of a failing module
π‘ Try: lazy import lazy_demo.heavy then access lazy_demo.heavy.compute()
to see the lazy import in action!
π‘ Test deferred errors: import lazy_demo.broken (succeeds), then call lazy_demo.broken.bar() (fails when lazy import triggers).