MyPy is a static type checker for Python that will show us where we are passing incorrect types.
It's also able to infer a lot of types so we don't have to annotate variables everywhere. It should be enough to type the parameters and maybe return values of all functions.
MyPy is a static type checker for Python that will show us where we are passing incorrect types. It's also able to infer a lot of types so we don't have to annotate variables everywhere. It should be enough to type the parameters and maybe return values of all functions.
Install
https://github.com/python/mypy
python3 -m pip install -U mypy
Run
mypy crawler.py
(instead ofpython crawler.py
)What?
This is only to help avoid errors in development, we can later run the same code with
python crawler.py
as well.How?