Skip to content

Commit a9ae051

Browse files
committed
Also update README
1 parent f29c65d commit a9ae051

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,16 @@ 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 package containing the
113+
subpackage to be imported immediately; thus, this usage is
114+
discouraged.**
115+
116+
You can ask `lazy.load` to raise import errors as soon as it is called:
111117

112118
```
113119
linalg = lazy.load('scipy.linalg', error_on_import=True)

0 commit comments

Comments
 (0)