Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
20 of 785 committers (2.5%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.5%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Optional static typing for Python
Basic Info
- Host: GitHub
- Owner: python
- License: other
- Language: Python
- Default Branch: master
- Homepage: https://www.mypy-lang.org/
- Size: 71.5 MB
Statistics
- Stars: 19,736
- Watchers: 240
- Forks: 2,999
- Open Issues: 2,985
- Releases: 0
Topics
Metadata Files
README.md
Mypy: Static Typing for Python
Got a question?
We are always happy to answer questions! Here are some good places to ask them:
- for general questions about Python typing, try typing discussions
- for anything you're curious about, try gitter chat
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:
- check our common issues page
- search our issue tracker to see if it's already been reported
To report a bug or request an enhancement:
- report at our issue tracker
- if the issue is with a specific library or function, consider reporting it at typeshed tracker or the issue tracker for that library
To discuss a new type system feature:
- discuss at discuss.python.org
- there is also some historical discussion at the typing-sig mailing list and the python/typing repo
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!
Here is a small example to whet your appetite:
python
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:
Quick start
Mypy can be installed using pip:
bash
python3 -m pip install -U mypy
If you want to run the latest version of the code, you can install from the repo directly:
bash
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:
bash
mypy PROGRAM
You can always use the Python interpreter to run your statically typed programs, even if mypy reports type errors:
bash
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:
bash
dmypy run -- PROGRAM
You can also try mypy in an online playground (developed by Yusuke Miyazaki).
Integrations
Mypy can be integrated into popular IDEs:
- VS Code: provides basic integration with mypy.
- Vim:
- Emacs: using Flycheck
- Sublime Text: SublimeLinter-contrib-mypy
- PyCharm: mypy plugin
- IDLE: idlemypyextension
- pre-commit: use pre-commit mirrors-mypy, although note by default this will limit mypy's ability to analyse your third party dependencies.
Web site and documentation
Additional information is available at the web site:
Jump straight to the documentation:
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.
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:
bash
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 the issue tracker at https://github.com/mypyc/mypyc
Owner
- Name: Python
- Login: python
- Kind: organization
- Website: https://www.python.org/
- Repositories: 88
- Profile: https://github.com/python
Repositories related to the Python Programming language
Committers
Last synced: 6 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Jukka Lehtosalo | j****o@i****i | 4,841 |
| Michael J. Sullivan | s****y@m****t | 856 |
| Ivan Levkivskyi | l****i@g****m | 793 |
| Shantanu | 1****a | 607 |
| Guido van Rossum | g****o@p****g | 309 |
| Guido van Rossum | g****o@d****m | 293 |
| Nikita Sobolev | m****l@s****e | 293 |
| Marc Mueller | 3****p | 217 |
| Sander Kersten | s****n@g****m | 198 |
| Alex Waygood | A****d@G****m | 166 |
| Michael Lee | m****a@g****m | 155 |
| David Fisher | d****1@g****m | 153 |
| Igor Vuk | p****a@g****m | 146 |
| Ethan Smith | e****n@e****e | 115 |
| Elazar Gershuni | e****g@g****m | 114 |
| jhance | j****e | 101 |
| Michael Pokorny | p****k@d****m | 100 |
| Xuanda Yang | t****e@g****m | 99 |
| Jelle Zijlstra | j****a@g****m | 92 |
| 97littleleaf11 | 9****1 | 80 |
| Stanislav Terliakov | 5****v | 79 |
| Eric Price | e****e@m****u | 68 |
| Ilya Priven | i****v@g****m | 67 |
| Svyatoslav Ilinskiy | i****v@g****m | 58 |
| Reid Barton | r****n@g****m | 55 |
| Greg Price | g****e@d****m | 54 |
| Brian Schubert | b****t@g****m | 42 |
| github-actions[bot] | 4****] | 41 |
| Ali Hamdan | a****v@g****m | 40 |
| Jared Pochtar | j****d@d****m | 38 |
| and 755 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 3,138
- Total pull requests: 3,002
- Average time to close issues: over 1 year
- Average time to close pull requests: about 1 month
- Total issue authors: 1,605
- Total pull request authors: 348
- Average comments per issue: 2.98
- Average comments per pull request: 2.64
- Merged pull requests: 2,040
- Bot issues: 0
- Bot pull requests: 79
Past Year
- Issues: 862
- Pull requests: 1,798
- Average time to close issues: 9 days
- Average time to close pull requests: 6 days
- Issue authors: 491
- Pull request authors: 168
- Average comments per issue: 1.18
- Average comments per pull request: 2.04
- Merged pull requests: 1,220
- Bot issues: 0
- Bot pull requests: 41
Top Authors
Issue Authors
- KotlinIsland (113)
- JukkaL (103)
- DetachHead (66)
- hauntsaninja (46)
- randolf-scholz (35)
- sobolevn (33)
- ilevkivskyi (30)
- bzoracler (29)
- Dreamsorcerer (29)
- finite-state-machine (26)
- JelleZijlstra (24)
- bersbersbers (24)
- asottile-sentry (21)
- A5rocks (20)
- NeilGirdhar (20)
Pull Request Authors
- JukkaL (350)
- cdce8p (330)
- ilevkivskyi (296)
- hauntsaninja (289)
- sterliakov (173)
- sobolevn (105)
- brianschubert (93)
- github-actions[bot] (62)
- hamdanal (54)
- svalentin (52)
- tyralla (49)
- A5rocks (47)
- wyattscarpenter (42)
- AlexWaygood (40)
- JelleZijlstra (32)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 12
-
Total downloads:
- pypi 65,006,985 last-month
- Total docker downloads: 2,085,803,744
-
Total dependent packages: 6,269
(may contain duplicates) -
Total dependent repositories: 53,705
(may contain duplicates) - Total versions: 422
- Total maintainers: 16
pypi.org: mypy
Optional static typing for Python
- Homepage: https://www.mypy-lang.org/
- Documentation: https://mypy.readthedocs.io/en/stable/index.html
- License: MIT
-
Latest release: 1.17.1
published 7 months ago
Rankings
Maintainers (11)
conda-forge.org: mypy
Add type annotations to your Python programs, and use mypy to type check them. Mypy is essentially a Python linter on steroids, and it can catch many programming errors by analyzing your program, without actually having to run it. Mypy has a powerful type system with features such as type inference, gradual typing, generics and union types.
- Homepage: http://mypy-lang.org
- License: MIT
-
Latest release: 0.991
published over 3 years ago
Rankings
conda-forge.org: mypy_extensions
The 'mypy_extensions' module defines experimental extensions to the standard 'typing' module that are supported by the mypy typechecker.
- Homepage: http://www.mypy-lang.org/
- License: MIT
-
Latest release: 0.4.3
published over 6 years ago
Rankings
proxy.golang.org: github.com/python/mypy
- Documentation: https://pkg.go.dev/github.com/python/mypy#section-documentation
- License: other
-
Latest release: v1.17.1
published 7 months ago
Rankings
anaconda.org: mypy
Add type annotations to your Python programs, and use mypy to type check them. Mypy is essentially a Python linter on steroids, and it can catch many programming errors by analyzing your program, withoutactually having to run it. Mypy has a powerful type system with features such as type inference, gradual typing, generics and union types.
- Homepage: https://www.mypy-lang.org/
- License: MIT
-
Latest release: 1.17.1
published 6 months ago
Rankings
conda-forge.org: mypyc
The compiled language is a strict, gradually typed Python variant. It restricts the use of some dynamic Python features to gain performance, but it's mostly compatible with standard Python. Mypyc uses mypy to perform type checking and type inference. Most type system features in the stdlib typing module are supported. Compiled modules can import arbitrary Python modules and third-party libraries. You can compile anything from a single performance-critical module to your entire codebase. You can run the modules you compile also as normal, interpreted Python modules. Existing code with type annotations is often 1.5x to 5x faster when compiled. Code tuned for mypyc can be 5x to 10x faster. Mypyc currently aims to speed up non-numeric code, such as server applications. Mypyc is also used to compile itself (and mypy).
- Homepage: https://mypyc.readthedocs.io
- License: MIT
-
Latest release: 0.991
published over 3 years ago
Rankings
github actions: python/mypy
Optional Static Typing for Python.
- Homepage: https://www.mypy-lang.org/
- License: other
-
Latest release: v1.17.1
published 7 months ago
Rankings
pypi.org: crgeo
Contains basic functionality for facilitating research on graph neural networks for autonomous driving and provides an interface between CommonRoad and Pytorch Geometric.
- Homepage: https://gitlab.lrz.de/cps/commonroad-geometric
- Documentation: https://crgeo.readthedocs.io/
- License: other
-
Latest release: 0.1.1
published over 2 years ago
Rankings
Maintainers (2)
pypi.org: zxgraphs
A vectorised implementation of ZX graphs.
- Documentation: https://zxgraphs.readthedocs.io/
- License: other
-
Latest release: 0.0.0
published 11 months ago
Rankings
Maintainers (1)
pypi.org: bismuth-mypy
Optional static typing for Python
- Homepage: https://www.mypy-lang.org/
- Documentation: https://mypy.readthedocs.io/en/stable/index.html
- License: MIT
-
Latest release: 1.11.2b3
published over 1 year ago
Rankings
Maintainers (1)
pypi.org: mypy-dev
Optional static typing for Python
- Documentation: https://mypy.readthedocs.io/en/stable/index.html
- License: MIT
-
Latest release: 1.18.0a7
published 6 months ago
Rankings
Maintainers (1)
anaconda.org: mypyc
Add type annotations to your Python programs, and use mypy to type check them. Mypy is essentially a Python linter on steroids, and it can catch many programming errors by analyzing your program, withoutactually having to run it. Mypy has a powerful type system with features such as type inference, gradual typing, generics and union types.
- Homepage: https://www.mypy-lang.org/
- License: MIT
-
Latest release: 1.17.1
published 6 months ago
Rankings
Dependencies
- types-typed-ast >=1.5.0,<1.6.0
- furo >=2022.3.4
- sphinx >=4.2.0,<5.0.0
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- actions/github-script v6 composite
- kanga333/comment-hider c12bb20b48aeb8fc098e35967de8d4f8018fffdf composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- ubuntu latest build
- mypy_extensions >=1.0.0
- tomli >=1.1.0
- typing_extensions >=4.1.0
- mypy_extensions *
- tomli >=1.1.0
- typing_extensions >=4.1.0
- attrs >=18.0 test
- black ==23.9.1 test
- filelock >=3.3.0 test
- lxml >=4.9.1,<4.9.3 test
- pre-commit * test
- pre-commit-hooks ==4.5.0 test
- psutil >=4.0 test
- pytest >=7.4.0 test
- pytest-cov >=2.10.0 test
- pytest-xdist >=1.34.0 test
- ruff ==0.1.0 test
- setuptools >=65.5.1 test
- tomli >=1.1.0 test
- attrs ==23.1.0 test
- black ==23.9.1 test
- cfgv ==3.4.0 test
- click ==8.1.7 test
- coverage ==7.3.2 test
- distlib ==0.3.7 test
- execnet ==2.0.2 test
- filelock ==3.12.4 test
- identify ==2.5.30 test
- iniconfig ==2.0.0 test
- lxml ==4.9.2 test
- mypy-extensions ==1.0.0 test
- nodeenv ==1.8.0 test
- packaging ==23.2 test
- pathspec ==0.11.2 test
- platformdirs ==3.11.0 test
- pluggy ==1.3.0 test
- pre-commit ==3.5.0 test
- pre-commit-hooks ==4.5.0 test
- psutil ==5.9.6 test
- pytest ==7.4.2 test
- pytest-cov ==4.1.0 test
- pytest-xdist ==3.3.1 test
- pyyaml ==6.0.1 test
- ruamel-yaml ==0.17.40 test
- ruamel-yaml-clib ==0.2.8 test
- ruff ==0.1.0 test
- setuptools ==68.2.2 test
- tomli ==2.0.1 test
- types-psutil ==5.9.5.17 test
- types-setuptools ==68.2.0.0 test
- typing-extensions ==4.8.0 test
- virtualenv ==20.24.5 test