Skip to content
Back to search

mypy

Optional static typing for Python

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/python/mypy with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/python/mypy'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/python--mypy/badge.svg)](/listings/python--mypy)

HTML

<a href="/listings/python--mypy"><img src="/api/listings/python--mypy/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Mypy can be installed using pip:

python3 -m pip install -U mypy

If you want to run the latest version of the code, you can install from the repo directly:

python3 -m pip install -U git+https://github.com/python/mypy.git

Now you can type-check the [statically typed parts] of a program like this:

mypy PROGRAM

You can always use the Python interpreter to run your statically typed programs, even if mypy reports type errors:

python3 PROGRAM

If you are working with large code bases, you can run mypy in [daemon mode], that will give much faster (often sub-second) incremental updates:

dmypy run -- PROGRAM

You can also try mypy in an [online playground](https://mypy-play.net/) (developed by Yusuke Miyazaki).

[statically typed parts]: https://mypy.readthedocs.io/en/latest/getting_started.html#function-signatures-and-dynamic-vs-static-typing [daemon mode]: https://mypy.readthedocs.io/en/stable/mypy_daemon.html

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 190 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <img src="docs/source/mypy_light.svg" alt="mypy logo" width="300px"/>
  2. Mypy: Static Typing for Python
  3. =======================================
  4. [![Stable Version](https://img.shields.io/pypi/v/mypy?color=blue)](https://pypi.org/project/mypy/)
  5. [![Downloads](https://img.shields.io/pypi/dm/mypy)](https://pypistats.org/packages/mypy)
  6. [![Build Status](https://github.com/python/mypy/actions/workflows/test.yml/badge.svg)](https://github.com/python/mypy/actions)
  7. [![Documentation Status](https://readthedocs.org/projects/mypy/badge/?version=latest)](https://mypy.readthedocs.io/en/latest/?badge=latest)
  8. [![Chat at https://gitter.im/python/typing](https://badges.gitter.im/python/typing.svg)](https://gitter.im/python/typing?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
  9. [![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
  10. [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
  11. [![Linting: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
  12. Got a question?
  13. ---------------
  14. We are always happy to answer questions! Here are some good places to ask them:
  15. - for general questions about Python typing, try [typing discussions](https://github.com/python/typing/discussions)
  16. - for anything you're curious about, try [gitter chat](https://gitter.im/python/typing)
  17. If you're just getting started,
  18. [the documentation](https://mypy.readthedocs.io/en/stable/index.html)
  19. and [type hints cheat sheet](https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html)
  20. can also help answer questions.
  21. If you think you've found a bug:
  22. - check our [common issues page](https://mypy.readthedocs.io/en/stable/common_issues.html)
  23. - search our [issue tracker](https://github.com/python/mypy/issues) to see if
  24. it's already been reported
  25. To report a bug or request an enhancement:
  26. - report at [our issue tracker](https://github.com/python/mypy/issues)
  27. - if the issue is with a specific library or function, consider reporting it at
  28. [typeshed tracker](https://github.com/python/typeshed/issues) or the issue
  29. tracker for that library
  30. To discuss a new type system feature:
  31. - discuss at [discuss.python.org](https://discuss.python.org/c/typing/32)
  32. - there is also some historical discussion at the [typing-sig mailing list](https://mail.python.org/archives/list/typing-sig@python.org/) and the [python/typing repo](https://github.com/python/typing/issues)
  33. What is mypy?
  34. -------------
  35. Mypy is a static type checker for Python.
  36. Type checkers help ensure that you're using variables and functions in your code
  37. correctly. With mypy, add type hints ([PEP 484](https://www.python.org/dev/peps/pep-0484/))
  38. to your Python programs, and mypy will warn you when you use those types
  39. incorrectly.
  40. Python is a dynamic language, so usually you'll only see errors in your code
  41. when you attempt to run it. Mypy is a *static* checker, so it finds bugs
  42. in your programs without even running them!
  43. Here is a small example to whet your appetite:
  44. ```python
  45. number = input("What is your favourite number?")
  46. print("It is", number + 1) # error: Unsupported operand types for + ("str" and "int")
  47. ```
  48. Adding type hints for mypy does not interfere with the way your program would
  49. otherwise run. Think of type hints as similar to comments! You can always use
  50. the Python interpreter to run your code, even if mypy reports errors.
  51. Mypy is designed with gradual typing in mind. This means you can add type
  52. hints to your code base slowly and that you can always fall back to dynamic
  53. typing when static typing is not convenient.
  54. Mypy has a powerful and easy-to-use type system, supporting features such as
  55. type inference, generics, callable types, tuple types, union types,
  56. structural subtyping and more. Using mypy will make your programs easier to
  57. understand, debug, and maintain.
  58. See [the documentation](https://mypy.readthedocs.io/en/stable/index.html) for
  59. more examples and information.
  60. In particular, see:
  61. - [type hints cheat sheet](https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html)
  62. - [getting started](https://mypy.readthedocs.io/en/stable/getting_started.html)
  63. - [list of error codes](https://mypy.readthedocs.io/en/stable/error_code_list.html)
  64. Quick start
  65. -----------
  66. Mypy can be installed using pip:
  67. ```bash
  68. python3 -m pip install -U mypy
  69. ```
  70. If you want to run the latest version of the code, you can install from the
  71. repo directly:
  72. ```bash
  73. python3 -m pip install -U git+https://github.com/python/mypy.git
  74. ```
  75. Now you can type-check the [statically typed parts] of a program like this:
  76. ```bash
  77. mypy PROGRAM
  78. ```
  79. You can always use the Python interpreter to run your statically typed
  80. programs, even if mypy reports type errors:
  81. ```bash
  82. python3 PROGRAM
  83. ```
  84. If you are working with large code bases, you can run mypy in
  85. [daemon mode], that will give much faster (often sub-second) incremental updates:
  86. ```bash
  87. dmypy run -- PROGRAM
  88. ```
  89. You can also try mypy in an [online playground](https://mypy-play.net/) (developed by
  90. Yusuke Miyazaki).
  91. [statically typed parts]: https://mypy.readthedocs.io/en/latest/getting_started.html#function-signatures-and-dynamic-vs-static-typing
  92. [daemon mode]: https://mypy.readthedocs.io/en/stable/mypy_daemon.html
  93. Integrations
  94. ------------
  95. Mypy can be integrated into popular IDEs:
  96. - VS Code: provides [basic integration](https://code.visualstudio.com/docs/python/linting#_mypy) with mypy.
  97. - Vim:
  98. - Using [Syntastic](https://github.com/vim-syntastic/syntastic): in `~/.vimrc` add
  99. `let g:syntastic_python_checkers=['mypy']`
  100. - Using [ALE](https://github.com/dense-analysis/ale): should be enabled by default when `mypy` is installed,
  101. or can be explicitly enabled by adding `let b:ale_linters = ['mypy']` in `~/vim/ftplugin/python.vim`
  102. - Emacs: using [Flycheck](https://github.com/flycheck/)
  103. - Sublime Text: [SublimeLinter-contrib-mypy](https://github.com/fredcallaway/SublimeLinter-contrib-mypy)
  104. - PyCharm: [mypy plugin](https://github.com/dropbox/mypy-PyCharm-plugin)
  105. - IDLE: [idlemypyextension](https://github.com/CoolCat467/idlemypyextension)
  106. - pre-commit: use [pre-commit mirrors-mypy](https://github.com/pre-commit/mirrors-mypy), although
  107. note by default this will limit mypy's ability to analyse your third party dependencies.
  108. Web site and documentation
  109. --------------------------
  110. Additional information is available at the web site:
  111. <https://www.mypy-lang.org/>
  112. Jump straight to the documentation:
  113. <https://mypy.readthedocs.io/>
  114. Follow along our changelog at:
  115. <https://mypy-lang.blogspot.com/>
  116. Contributing
  117. ------------
  118. Help in testing, development, documentation and other tasks is
  119. highly appreciated and useful to the project. There are tasks for
  120. contributors of all experience levels.
  121. To get started with developing mypy, see [CONTRIBUTING.md](CONTRIBUTING.md).
  122. Mypyc and compiled version of mypy
  123. ----------------------------------
  124. [Mypyc](https://github.com/mypyc/mypyc) uses Python type hints to compile Python
  125. modules to faster C extensions. Mypy is itself compiled using mypyc: this makes
  126. mypy approximately 4 times faster than if interpreted!
  127. To install an interpreted mypy instead, use:
  128. ```bash
  129. python3 -m pip install --no-binary mypy -U mypy
  130. ```
  131. To use a compiled version of a development
  132. version of mypy, directly install a binary from
  133. <https://github.com/mypyc/mypy_mypyc-wheels/releases/latest>.
  134. To contribute to the mypyc project, check out the issue tracker at <https://github.com/mypyc/mypyc>

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.