An Update on Pytype

github.com

72 points by mxmlnkn 2 hours ago


zem - 4 minutes ago

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.

underdeserver - 2 hours ago

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/

froh - 20 minutes ago

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

jdlyga - an hour ago

I'm surprised Google still maintained their own solution for this for so long. The standard for statically type checking Python nowadays is mypy.

kubb - an hour ago

Maybe they could do typechecking using an LLM agent? I'm sure they'd fund a team for that.

sito42 - an hour ago

astral bags another one

ccbncvnnccvbj - an hour ago

Free fire 2018

delduca - an hour ago

Another abandoned project from Google? Not surprised. Never trust on Google.

md3911027514 - 2 hours ago

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.