File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -104,10 +104,16 @@ internal imports.
104
104
Use ` lazy.load ` to lazily import external libraries:
105
105
106
106
``` 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(... )
108
109
```
109
110
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:
111
117
112
118
```
113
119
linalg = lazy.load('scipy.linalg', error_on_import=True)
You can’t perform that action at this time.
0 commit comments