Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ detail](https://scientific-python.org/specs/spec-0001/#type-checkers).

With lazy loading, missing imports no longer fail upon loading the
library. During development and testing, you can set the `EAGER_IMPORT`
environment variable to disable lazy loading.
environment variable to "1" or "true" to disable lazy loading ("0" or "" re-enables lazy loading).

### External libraries

Expand Down
3 changes: 2 additions & 1 deletion src/lazy_loader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def __getattr__(name):
def __dir__():
return __all__.copy()

if os.environ.get("EAGER_IMPORT", ""):
eager_import = os.environ.get("EAGER_IMPORT", "") not in ("0", "")
if eager_import:
for attr in set(attr_to_modules.keys()) | submodules:
__getattr__(attr)

Expand Down
Loading