Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The two are complementary: the built-in `typing` module only provides type annotations, not type checking. Mypy provides the latter, via the type annotations that you (and others) add to Python codebases.

Pydantic overlaps with mypy in the sense that it provides a mypy plugin, but otherwise it's just like any other Python library.



So mypy runs "at run time"? I guess that makes sense, I thought the annotations provided some form of checking too, but now I realize that I should really spend some time to inform myself better :').


Sort of -- mypy is its own standalone program, and you run it to typecheck your program's type annotations. It does some evaluation of the Python program (specifically imports and some very basic conditional evaluation, among other things), but it never really executes the codebase itself.


Mypy runs as a type linter/checker. See https://mypy-lang.org/


No, it's more that pydantic runs "at run time" while mypy not.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: