
Pytype – A static type analyzer for Python code - fanf2
https://github.com/google/pytype
======
melling
I guess someone posted this in response to this HN post:

[https://news.ycombinator.com/item?id=19473631](https://news.ycombinator.com/item?id=19473631)

People tend to do that on HN.

So, for those of us who don’t use Python type checking, which of the 4
checkers do we choose? Google, Facebook, Dropbox, or the new one: Pyright?

~~~
CloudYeller
Not to be a total smartass, but if your Python codebase is not that big yet,
then the correct answer is none of the above- rewrite in a compiled language
if you find the lack of static checks disturbing.

I have been using "type checked" python for a year and let me tell you, it is
not even 10% as good as having a real compiler. Python type checkers are not
even close to 100% accuracy.

If you're going to use a python type checker, use the one that has the most
dev resources behind it. Which probably means, whichever company has the most
internal python code, which is probably Google. So pytype.

But bear in mind, these things are only sensible when you've written so much
python code that it's too late to rewrite in a better language. If you're in
that situation, even though these checkers are far from perfect, they are a
massive improvement over plain python.

~~~
melling
I only asked for an evaluation of the current Python checkers, not a
philosophy lesson.

In theory there's no difference between theory and practice, but in practice
there is.

So, in practice which is the best current Python type checker?

------
kissgyorgy
I can't find the reasoning why is this better than mypy? Why not contribute to
mypy instead of a new tool?

~~~
ty120
The docs say that it works without type hints. Looking at the code base, it is
far too large to contribute to another project that appears to be quite
opinionated.

~~~
Too
mypy can also do type inference

~~~
gpshead
not to the same extent.

~~~
Too
Got any example?

------
yodon
See also yesterday's conversation about Microsoft's static type analyzer for
Python[0]

[0]
[https://news.ycombinator.com/item?id=19473631](https://news.ycombinator.com/item?id=19473631)

------
computerex
> Windows is currently not supported.

