Skip to content

Commit 563064d

Browse files
Czakistefanv
andauthored
Apply suggestions from code review
Co-authored-by: Stefan van der Walt <sjvdwalt@gmail.com>
1 parent 5e82813 commit 563064d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,15 @@ Except that all subpackages (such as `rank`) and functions (such as `sobel`) are
7777
Static type checkers and IDEs cannot infer type information from
7878
lazily loaded imports. As a workaround you can load [type
7979
stubs](https://mypy.readthedocs.io/en/stable/stubs.html) (`.pyi`
80-
files) with `lazy.attach_stub`.
80+
files) with `lazy.attach_stub`:
8181

8282
```python
8383
import lazy_loader as lazy
8484
__getattr__, __dir__, _ = lazy.attach_stub(__name__, "subpackages.pyi")
8585
```
8686

87-
In such scenario the `lazy_loader` determine imports base on `.pyi`,
88-
so `.pyi` files are then required not only for type checking but also in runtime.
89-
(during freezing app that uses library using `lazy_loader` it is required to collect also `.pyi` files)
87+
Note that, since imports are now defined in `.pyi` files, those
88+
are not only necessary for type checking but also at runtime.
9089

9190
The SPEC [describes this workaround in more
9291
detail](https://scientific-python.org/specs/spec-0001/#type-checkers).

0 commit comments

Comments
 (0)