All Projects → python → Mypy

python / Mypy

Licence: other
Optional static typing for Python

Programming Languages

python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language
PLSQL
303 projects
C++
36643 projects - #6 most used programming language
XSLT
1337 projects
shell
77523 projects

Projects that are alternatives of or similar to Mypy

Pytype
A static type analyzer for Python code
Stars: ✭ 3,545 (-70.45%)
Mutual labels:  linter, typing, typechecker
flake8-mypy
A plugin for flake8 integrating Mypy.
Stars: ✭ 103 (-99.14%)
Mutual labels:  linter, typing
typesentry
Python 2.7 & 3.5+ runtime type-checker
Stars: ✭ 19 (-99.84%)
Mutual labels:  typechecker, typing
Yamllint
A linter for YAML files.
Stars: ✭ 1,750 (-85.41%)
Mutual labels:  linter
Abaplint
Standalone linter for ABAP
Stars: ✭ 111 (-99.07%)
Mutual labels:  linter
Editorconfig Checker
A tool to verify that your files are in harmony with your .editorconfig
Stars: ✭ 119 (-99.01%)
Mutual labels:  linter
Ansible Lint Action
GitHub Action for running ansible-lint as part of your workflows! [ https://github.com/marketplace/actions/ansible-lint ]
Stars: ✭ 124 (-98.97%)
Mutual labels:  linter
Scopelint
scopelint checks for unpinned variables in go programs
Stars: ✭ 110 (-99.08%)
Mutual labels:  linter
Typedload
Python library to load dynamically typed data into statically typed data structures
Stars: ✭ 120 (-99%)
Mutual labels:  typing
Flint
Fast and configurable filesystem (file and directory names) linter
Stars: ✭ 115 (-99.04%)
Mutual labels:  linter
Cfn Python Lint
CloudFormation Linter
Stars: ✭ 1,770 (-85.24%)
Mutual labels:  linter
Norman
Norman keyboard layout - alternative to QWERTY for touch typing in English
Stars: ✭ 112 (-99.07%)
Mutual labels:  typing
Lesshint
A tool to aid you in writing clean and consistent Less.
Stars: ✭ 119 (-99.01%)
Mutual labels:  linter
Typer
A JavaScript typing library with sexy syntax and diddly dependencies.
Stars: ✭ 111 (-99.07%)
Mutual labels:  typing
Liche
Fast Link Checker for Markdown and HTML in Go
Stars: ✭ 123 (-98.97%)
Mutual labels:  linter
Typical
Typical: Fast, simple, & correct data-validation using Python 3 typing.
Stars: ✭ 111 (-99.07%)
Mutual labels:  typing
Dataclass factory
Modern way to convert python dataclasses or other objects to and from more common types like dicts or json-like structures
Stars: ✭ 116 (-99.03%)
Mutual labels:  typing
Dockle
Container Image Linter for Security, Helping build the Best-Practice Docker Image, Easy to start
Stars: ✭ 1,713 (-85.72%)
Mutual labels:  linter
Cargo Deadlinks
Cargo subcommand for checking your documentation for broken links
Stars: ✭ 113 (-99.06%)
Mutual labels:  linter
Surelog
SystemVerilog 2017 Pre-processor, Parser, Elaborator, UHDM Compiler. Provides IEEE Design/TB C/C++ VPI and Python AST API.
Stars: ✭ 116 (-99.03%)
Mutual labels:  linter

mypy logo

Mypy: Static Typing for Python

Build Status Documentation Status Chat at https://gitter.im/python/typing Checked with mypy

Got a question?

We are always happy to answer questions! Here are some good places to ask them:

If you're just getting started, the documentation and type hints cheat sheet can also help answer questions.

If you think you've found a bug:

To report a bug or request an enhancement:

To discuss a new type system feature:

What is mypy?

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!

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.

Here is a small example to whet your appetite:

number = input("What is your favourite number?")
print("Well, my favourite number is: ", number + 1)  # error: Unsupported operand types for + ("str" and "int")

See the documentation for more examples.

In particular, see:

Quick start

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 git:

python3 -m pip install -U git+git://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

You can also try mypy in an online playground (developed by Yusuke Miyazaki).

Integrations

Mypy can be integrated into popular IDEs:

Web site and documentation

Additional information is available at the web site:

http://www.mypy-lang.org/

Jump straight to the documentation:

https://mypy.readthedocs.io/

Follow along our changelog at:

https://mypy-lang.blogspot.com/

Contributing

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.

Development status

Mypy is beta software, but it has already been used in production for several years at Dropbox and in many other organizations, and it has an extensive test suite.

mypyc and compiled version of mypy

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 https://github.com/mypyc/mypyc

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].