Closed ecomodeller closed 2 hours ago
Enables derived package to use type checkers (e.g. mypy, pyright) to find bugs: https://typing.readthedocs.io/en/latest/spec/distributing.html#packaging-typed-libraries
import mikeio def main(ds: mikeio.Dataset): print(ds.item[0])
Before: 😢
$ mypy hello.py hello.py:1: error: Skipping analyzing "mikeio": module is installed, but missing library stubs or py.typed marker [import-untyped] hello.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports Found 1 error in 1 file (checked 1 source file)
After: 😄
$ mypy hello.py hello.py:4: error: "Dataset" has no attribute "item"; maybe "items"? [attr-defined] Found 1 error in 1 file (checked 1 source file)
Enables derived package to use type checkers (e.g. mypy, pyright) to find bugs: https://typing.readthedocs.io/en/latest/spec/distributing.html#packaging-typed-libraries
Before: 😢
After: 😄