mypy is a static type checker for Python that analyzes source code to detect type errors and inconsistencies without executing the program. It functions as a static analysis tool and type inference engine, providing a gradual typing system that allows type hints to be added to a codebase incrementally while maintaining compatibility with dynamic typing.
The main features of python/mypy are: Gradual Typing Systems, Automatic Type Deduction, External Library Definitions, Type Narrowing, Abstract Syntax Tree Parsers, Python Type Checkers, Gradual Typing Adoption, Type Inference Engines.
Open-source alternatives to python/mypy include: google/pytype — Pytype is a static code analysis tool and type inference engine for Python. It functions as a static type analyzer… facebook/pyrefly — Pyrefly is a static type checker for Python that operates as a language server, delivering real-time diagnostics,… microsoft/pyright — Pyright is a static type checker for Python designed to validate type hints and identify potential errors within large… python/typeshed — Typeshed is a collection of static type definitions and stubs for the Python standard library and third-party… astral-sh/ty — This project is a high-performance static type checker and comprehensive development toolkit for Python. It functions… facebook/pyre-check — Pyre is a high-performance static type checker and analysis tool for Python. It identifies type errors and ensures…
Pytype is a static code analysis tool and type inference engine for Python. It functions as a static type analyzer that detects type mismatches and verifies type annotations without requiring full manual hinting, while also serving as a type stub generator for producing standalone definition files. The project distinguishes itself by automatically determining variable and function types through an analysis of code patterns and assignments. This inference engine allows for structural code verification and the generation of type stubs that describe the interfaces of modules and functions. The
Pyrefly is a static type checker for Python that operates as a language server, delivering real-time diagnostics, completions, and navigation in any editor supporting the Language Server Protocol. It also performs static tensor shape analysis, using symbolic dimension variables and arithmetic to verify shape consistency in deep learning models without runtime execution. Beyond core type checking, Pyrefly supports gradual adoption workflows: it can generate a baseline of known errors so only new issues are reported, migrate configuration from other type checkers, and automatically suppress exi
Pyright is a static type checker for Python designed to validate type hints and identify potential errors within large codebases. It functions as a command-line utility that integrates into local development environments and continuous integration pipelines to ensure code quality and consistency. The tool distinguishes itself through a high-performance analysis engine that utilizes incremental dependency graph analysis and persistent state caching to re-evaluate only the affected portions of a project. By implementing the Language Server Protocol, it provides real-time feedback, including err
Typeshed is a collection of static type definitions and stubs for the Python standard library and third-party packages. It serves as a standardized resource for static analyzers and integrated development environments to validate code correctness and provide type-based code completion without modifying the original source code of the libraries. The project focuses on the creation and maintenance of external type hint files that separate type annotations from runtime implementation. It utilizes a system for versioning and mapping these stubs to specific versions of runtime packages to maintain