Contents

mypy 1.9.0

0

Optional static typing for Python

Optional static typing for Python

Stars: 17476, Watchers: 17476, Forks: 2679, Open Issues: 2765

The python/mypy repo was created 11 years ago and the last code push was 3 hours ago.
The project is extremely popular with a mindblowing 17476 github stars!

How to Install mypy

You can install mypy using pip

pip install mypy

or add it to a project with poetry

poetry add mypy

Package Details

Author
Jukka Lehtosalo
License
MIT
Homepage
https://www.mypy-lang.org/
PyPi:
https://pypi.org/project/mypy/
Documentation:
https://mypy.readthedocs.io/en/stable/index.html
GitHub Repo:
https://github.com/python/mypy

Classifiers

  • Software Development
No  mypy  pypi packages just yet.

Errors

A list of common mypy errors.

Code Examples

Here are some mypy code examples and snippets.

GitHub Issues

The mypy package has 2765 open issues on GitHub

  • Treat methods with empty bodies in Protocols as abstract
  • MyPy fails to install with pyenv/poetry due to typed-ast dependency
  • Use union instead of join for unifying types
  • Show ignored errors
  • Fix two type inference bugs related to enum value attributes
  • Incompatible return value type (got "function", expected "Callable[…, Any]")
  • Add –allow-empty-dir option
  • Unexpected type inference changes related to enum value attributes
  • Fix TypeGuard Explicit Any Check
  • Explicit Any check for TypeGuard
  • Error on instance property and init-only variable with the same name in a dataclass
  • Adding init breaks type inference from new
  • Fix format checking for Unions with alias with custom format
  • [mypyc] Implement close method for generators
  • Fix crash involving explicit any flag and Required

See more issues on GitHub

Related Packages & Articles

flake8 7.0.0

the modular source code checker: pep8 pyflakes and co