Skip to content

Commit cb5ec15

Browse files
committed
Also update README
1 parent f29c65d commit cb5ec15

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,15 @@ internal imports.
104104
Use `lazy.load` to lazily import external libraries:
105105

106106
```python
107-
linalg = lazy.load('scipy.linalg') # `linalg` will only be loaded when accessed
107+
sp = lazy.load('scipy') # `sp` will only be loaded when accessed
108+
sp.linalg.norm(...)
108109
```
109110

110-
You can also ask `lazy.load` to raise import errors as soon as it is called:
111+
**Note that lazily importing *sub*packages,
112+
i.e. `load('scipy.linalg')` will cause the parent module to be
113+
imported immediately, thus this usage is discouraged.**
114+
115+
You can ask `lazy.load` to raise import errors as soon as it is called:
111116

112117
```
113118
linalg = lazy.load('scipy.linalg', error_on_import=True)

0 commit comments

Comments
 (0)