diff --git a/README.md b/README.md index 17c255e..ab35b98 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/lazy_loader/__init__.py b/src/lazy_loader/__init__.py index 0b0243e..319166f 100644 --- a/src/lazy_loader/__init__.py +++ b/src/lazy_loader/__init__.py @@ -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)