|Project Name||Stars||Downloads||Repos Using This||Packages Using This||Most Recent Commit||Total Releases||Latest Release||Open Issues||License||Language|
|Mypy||16,836||3,042||6,707||20 hours ago||112||November 23, 2023||2,557||other||Python|
|Optional static typing for Python|
|Esdc Ce||98||a year ago||55||apache-2.0||Python|
|Danube Cloud :: Community Edition|
|Vorbis||36||43||12||2 years ago||6||September 29, 2021||1||mit||C#|
|Vorbis decoder for NAudio|
|Fastrespawn||8||5 years ago||2||PHP|
|PocketMine plugin that removed red screen when die|
|Esdc Docs||6||2 years ago||apache-2.0||HTML|
|Danube Cloud :: Documentation|
|Anteup||5||8 days ago||6||PHP|
|e107v2: Donation Tracker Plugin|
|Condep Cli||4||5 years ago||other||C#|
|ConDep.exe - The CLI for ConDep|
We are always happy to answer questions! Here are some good places to ask them:
If you think you've found a bug:
To report a bug or request an enhancement:
To discuss a new type system feature:
Mypy is a static type checker for Python.
Type checkers help ensure that you're using variables and functions in your code correctly. With mypy, add type hints (PEP 484) to your Python programs, and mypy will warn you when you use those types incorrectly.
Python is a dynamic language, so usually you'll only see errors in your code when you attempt to run it. Mypy is a static checker, so it finds bugs in your programs without even running them!
Here is a small example to whet your appetite:
number = input("What is your favourite number?") print("It is", number + 1) # error: Unsupported operand types for + ("str" and "int")
Adding type hints for mypy does not interfere with the way your program would otherwise run. Think of type hints as similar to comments! You can always use the Python interpreter to run your code, even if mypy reports errors.
Mypy is designed with gradual typing in mind. This means you can add type hints to your code base slowly and that you can always fall back to dynamic typing when static typing is not convenient.
Mypy has a powerful and easy-to-use type system, supporting features such as type inference, generics, callable types, tuple types, union types, structural subtyping and more. Using mypy will make your programs easier to understand, debug, and maintain.
See the documentation for more examples and information.
In particular, see:
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 # or if you don't have 'git' installed python3 -m pip install -U https://github.com/python/mypy/zipball/master
Now you can type-check the statically typed parts of a program like this:
You can always use the Python interpreter to run your statically typed programs, even if mypy reports type errors:
You can also try mypy in an online playground (developed by Yusuke Miyazaki). 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
Mypy can be integrated into popular IDEs:
Additional information is available at the web site:
Jump straight to the documentation:
Follow along our changelog at:
Help in testing, development, documentation and other tasks is highly appreciated and useful to the project. There are tasks for contributors of all experience levels.
To get started with developing mypy, see CONTRIBUTING.md.
If you need help getting started, don't hesitate to ask on gitter.
Mypyc uses Python type hints to compile Python modules to faster C extensions. Mypy is itself compiled using mypyc: this makes mypy approximately 4 times faster than if interpreted!
To install an interpreted mypy instead, use:
python3 -m pip install --no-binary mypy -U mypy
To use a compiled version of a development version of mypy, directly install a binary from https://github.com/mypyc/mypy_mypyc-wheels/releases/latest.
To contribute to the mypyc project, check out mypyc/mypyc