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

Pyright and mypy are typecheckers, completely orthogonal to the interpreter. They work like linters that statically perform type checking. By default, Python's type hints are ignored at runtime (i.e. you can do `x: str = 2`, and the runtime doesn't care), but there are tools to perform runtime checks (e.g. beartype) and libraries that make use of types as metadata (e.g. dataclasses, Pydantic, FastAPI).


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

Search: