We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent acbce79 commit 5e82813Copy full SHA for 5e82813
README.md
@@ -79,6 +79,15 @@ lazily loaded imports. As a workaround you can load [type
79
stubs](https://mypy.readthedocs.io/en/stable/stubs.html) (`.pyi`
80
files) with `lazy.attach_stub`.
81
82
+```python
83
+import lazy_loader as lazy
84
+__getattr__, __dir__, _ = lazy.attach_stub(__name__, "subpackages.pyi")
85
+```
86
+
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)
90
91
The SPEC [describes this workaround in more
92
detail](https://scientific-python.org/specs/spec-0001/#type-checkers).
93
0 commit comments