I've read a lot of good things about Google's `pytype`, which supposedly does a better job inferring types of unannotated code than `mypy`. Has anyone used `pytype` seriously, and does it compare? Is there a reason to prefer `mypy` at all, other than the fact that it's (mostly) first-party?
So, I tried out pytype the other day, and it was a not a good experience. It doesn't support PEP 420 (implicit namespace packages), which means you have to litter __init__.py files everywhere, or it will create filename collisions. See https://github.com/google/pytype/issues/198 for more information. I've since started testing out pyre.
pytype works by symbolic execution of compiled python bytecode, and the bytecode changed a fair bit between 3.10 and 3.11. we essentially have to implement some of the new features of the cpython interpreter first to simply execute 3.11 code, after which we need to handle new typing features. (we have to do this for every new version, but usually the bytecode doesn't change as much, it's typically new python features like pattern matching, and new typing features like variadic generics, that take time to implement in pytype)
Tangential, but is there a way to annotate an expression as non-nullable? In TS we have `expression!`, but in Python we have to `assert var is not None` after `var = fn_that_returns_str_or_none`.