Upon adding this line import lxml.html vim displays No library stub file for module lxml.html.
What does it mean?
Mypy makes use of a package called TypeShed. Typeshed contains type stubs for the python standard library and a few third party packages. lxml isn't represented there. So the type checker doesn't know about the types within lxml.
Stubs are explained here: https://github.com/python/mypy/wiki/Creating-Stubs-For-Python-Modules
The stub file for lxml.html was not available until version 0.2.0 (released in May 2021). You can just pip install lxml-stubs --upgrade.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With