When comparing mypy vs pyflakes, the Slant community recommends mypy for most people. In the question“What are the best Python code linters?” mypy is ranked 5th while pyflakes is ranked 7th. The most important reason people chose mypy is:
Mypy's type checker checks the types of function parameters, supports type inference, typed collections and has even some support for generics.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Powerful type checker
Mypy's type checker checks the types of function parameters, supports type inference, typed collections and has even some support for generics.
Pro Works in a truly static way
Mypy works in a truly static way. The checker makes all the checks before the code is actually run, but it still catches a lot of bugs.
Pro Very fast
Because it looks for errors from a small group of possible mistakes, pyflakes is very fast. When dealing with many lines of code this is a very useful feature. When used in conjunction with an IDE, it checks the code as it's being edited.
Pro Easy installation
The installation process for pyflakes is as easy as it can be. Can be installed with easy_install
or pip
and you are ready to go.
Cons
Con Still an experimental project
Mypy is still an unfinished experimental project. It is prone to bugs and to features being changed and removed. Plus, a large part of Python features is yet to be implemented.
Con Not very powerful
Pyflakes only checks for names that are defined but never used or names that are redefined without being used. It also does not have command line options that offer a degree of control for the tests that you are running.