@mathieu sorry if I oversold mypy 😕
@wjt oh you didn't. I had meant to check it out for a while anyway.
It does add a lot of good stuff to Python. E.g it found a bug that is trivial for a type system to find (a function can return None in some cases, I assumed it always returned an int) but would have been extremely easy to overlook (it "never" happens, it's just a side note in the docs…) and would have broken the production at runtime.
So it's already a net positive. 🙂
It's just that a proper type system could do much more.
@wjt also, a big part of why mypy is not enough is that most libraries don't have type annotations (because they are completely optional) so there's a lot it can't do.
There's a repo of stubs, things are improving…
But due to type annotations being, well, optional annotations (rather than actually checked and enforced) progress is slow and it will be years before we have a really great type checking system for Python.
Who knows, maybe Python 4 would make them mandatory? 😅
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!