Can I use a typed function definition from one stub file in another? E.g., I have my __init__.pyi
and also extractor.pyi
.
We want to reference some methods from extractor.py
, so we keep compatibility and not redefine types.
In extractor.pyi
I have:
def _func(arg: str) -> str: ...
Now I use in __init__.pyi
:
from .extractor import _func
However, my linter is complaining.
Is it, in general, possible to import stubs from other .pyi
files? If yes, how should I do it correctly?