3 ms·
After years of apologizing for Python's typing (that I still think is super useful!), I honestly want one of two things for Python: - Mostly just adopt Typescr
by rtpg 3y ago
After years of apologizing for Python's typing (that I still think is super useful!), I honestly want one of two things for Python:
- Mostly just adopt Typescript's model, unsafety and all. So many people work in Python + TS, and grumble about TS being able to handle _real issues_, and Python failing to catch issues because its type system is too weak (well, mypy's is)
- Just go all out on a dependent type system. This is a variant on TS, but where we get some better handling of dictionaries (giving us things like filtering down keys and the like), and generally letting us actually model tricky things.
People want errors to be caught! I do at least. And part of that involves being able to express properties about the keys of some dictionary, or the arity of some tuple, and operate off of that.
There's a lot of people being exposed to these systems, and I think a very good opportunity to provide a serious system. The fact that we aren't even compiling Python gives so much space for exploration here.