algoneer
mypy
Our great sponsors
algoneer | mypy | |
---|---|---|
1 | 61 | |
11 | 13,316 | |
- | 1.3% | |
0.0 | 9.8 | |
over 1 year ago | 6 days ago | |
Python | Python | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
algoneer
-
Adoption of Mypy for Python type checking: 45% already use it, 40% don't plan to
I gave a presentation on type checking at the EuroPython 2017 where I also investigated how many Python projects really use type checking, I present the results at the end (35 minutes in):
https://www.youtube.com/watch?v=vM2Zoy4Sxhk&t=2181s
My conclusion was that only a small fraction of projects really used them, there were a lot of projects that had type checks in their code but only in "homeopathic" doses.
I started using them for some of my Python projects as well (e.g https://github.com/algoneer/algoneer) and while I find them useful I think they're not as useful as a "real" type system in a fully typed language like Golang. Still, they're very useful for discovering simple mistakes that would only show up in unit testing otherwise.
You can also "misuse" them for other purposes, at the end of the presentation I e.g. show how you can implement software contracts with them. Of course this would wreck a type checker like mypy, so don't do that in your codebase. That's probably also one of my critiques as the annotation syntax can in principle be used for anything, but mypy and other tools are not able to deal with code that does that.
mypy
-
CONSTant hate towards Java
It won't have a runtime effect but if you violate it in your code somewhere it will cause static analysis tools such as Mypy to throw errors.
-
What's New in Python 3.11?
It looks like there's a PEP for that already! [0]
And as (almost) always, Pyright has already implemented the provisional PEP!
-
Don't let dicts spoil your code
They don't work in the way you would think for dataclasses or at all for dicts/TypedDicts.
See this for dataclasses: https://github.com/python/mypy/issues/5374#issuecomment-8841....
- mypy: Optional static typing for Python
-
why python is not used in game development? And why are the C+ and C# languages favored?
It's worth noting that Python 3.5+ added standardized type annotations for 3rd party type checkers to leverage. I pretty much use them all the time now except for extremely small scripts. My 3rd party type checker of choice is mypy.
-
You Should Compile Your Python and Here’s Why
how, when mypy itself has only "type: ignore" as a workaround for many scenarios?
here's a list of 41 issues where either the user or the mypy devs are saying "use type: ignore as a workaround for now":
https://github.com/python/mypy/issues?q=is%3Aopen+label%3Afa...
- Discussion Thread
-
Python’s “Type Hints” are a bit of a disappointment to me
It reminds me of this 5 year old bug in mypy: "int is not a Number?" [1].
-
Creating A Modern Python Development Environment
Mypy is an optional static type checker that aims to combine the benefits of dynamic (or “duck”) typing and static typing. The benefits of statically typed code are increased readability and maintainability. For an existing code base here's a guide on how to implement Mypy.
-
This Week In Python
mypy – Optional static typing for Python
What are some alternatives?
pyright - Static type checker for Python
pyre-check - Performant type-checking for python.
black - The uncompromising Python code formatter
pytype - A static type analyzer for Python code
Flake8 - flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.
typing - Python static typing home. Hosts the documentation and a user help forum.
PythonBuddy - 1st Online Python Editor With Live Syntax Checking and Execution
mypyc - Compile type annotated Python to fast C extensions
pylama - Code audit tool for python.
fastapi - FastAPI framework, high performance, easy to learn, fast to code, ready for production
bandit - Bandit is a tool designed to find common security issues in Python code.
prospector - Inspects Python source files and provides information about type and location of classes, methods etc