16 comments

[ 2.9 ms ] story [ 42.1 ms ] thread
Pytype was cool before Python type annotations became widespread. It seems to me like the industry is naturally moving toward native type annotations and linters and away from static analyzers like Pytype and mypy.
I think this is for the best.

I used Pytype at Google years ago and while it's well written and the team was responsive, ultimately Python is not well suited for type checking Python. It's compute intensive.

I think the Ty people at Astral have the correct idea, and hope it'll work out.

https://docs.astral.sh/ty/

Maybe they could do typechecking using an LLM agent? I'm sure they'd fund a team for that.
Another abandoned project from Google? Not surprised. Never trust on Google.
astral bags another one
I'm surprised Google still maintained their own solution for this for so long. The standard for statically type checking Python nowadays is mypy.
in the related FAQ https://github.com/google/pytype/issues/1925 they point explicitly to the future:

> What alternatives can I consider? There are four Python static type checkers that can be considered: mypy and Pyright have been released to the community for a while and have well established user bases. Pyrefly, ty were announced recently at PyCon US 2025 and are in active development stage in the current time of August 2025 when this was written.

mypy - https://github.com/python/mypy

Pyright - https://github.com/microsoft/pyright

Pyrefly - https://github.com/facebook/pyrefly

ty - https://github.com/astral-sh/ty

ex-pytype dev here - we knew this was coming and it's definitely the right thing to do, but it's still a little sad to see the end of an era. in particular, pytype's ability to do flow-based analysis across function boundaries (type checking calls to unannotated functions by symbolically executing the function body with the types of the call arguments) has not been implemented by any of the other checkers (again for good reasons; it's a performance hit and the world is moving towards annotations over pure inference anyway, but I still think it's a nice feature to have and makes for more powerful checking).

as an aside, while I agree that bytecode-based analysis has its drawbacks, I think it's a tool worth having in the overall python toolbox. I spun off pycnite from pytype in the hope that anyone else who wanted to experiment with it would have an easier time getting started - https://github.com/google/pycnite

I have recently jumped onto the "write python tooling in rust" bandwagon and might look into a rust reimplementation of pycnite at some point, because I still feel that bytecode analysis lets you reuse a lot of work the compiler has already done for you.

I worked on https://github.com/Microsoft/PTVS (not being in MSFT) around 2019 so I know they did type check calls across function boundaries.
neat. did they also do it by symbolically executing the function body?
tl;dr please use pyright instead
DAE GOole killing another project?!!! (Apparently maintaining something completely free of charge for 13 years is not enough for online cannibals)