Hacker News new | ask | show | jobs
by throwaway894345 1921 days ago
Also, Mypy has a thousand paper cuts compared to other type systems. Pretty sure we still can't model JSON in Mypy (e.g., JSON = Union[List['JSON'], Dict[str, 'JSON'], None, bool, int, float, str] or whatever) because Mypy doesn't support recursive types. Moreover, since it's largely shoehorned into existing Python syntax, it's very awkward. E.g., I'm still not sure what the scoping rules are for TypeVar, describing a callback that takes kwargs involves defining a protocol class with a `__call__()` method that takes your function's kwargs, etc. Further, getting the type definitions to load properly is incredibly painful, the error message directs you to a page with a few things you might try to debug further, but never has my issue been among them. Also, like everything in the Python world, Mypy is slow, and you really want your type checks to be instant.

Most of these things can be improved upon, but progress feels slow and there are so many other serious issues in the Python ecosystem (performance, package management, etc) that I've given up (after 15 years of daily use). It makes me sad, but Go and Rust seem to offer better tradeoffs for the things that I care about.