Hacker News new | ask | show | jobs
by CloudYeller 2647 days ago
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.

3 comments

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?

Have you tried PyRight? It claims to be much better than mypy.
What are the issues with mypy + python compared to say, Java?