import_lazy
LazyImport ¶
Bases: Generic[LazyValueT]
A lazy import that loads the actual object on first access.
Source code in stdl/import_lazy.py
import_lazy ¶
import_lazy(module: str, names: list[str] | None = None, alias: str | None = None, verbose: bool = False) -> None
Lazy import a module.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
module
|
str
|
Module name to import |
required |
names
|
list[str] | None
|
List of specific names to import from the module. If None, imports the module itself. |
None
|
alias
|
str | None
|
Alias to use for the imported module (only valid when names is None) |
None
|
verbose
|
bool
|
If True, print timing information when imports actually happen |
False
|