Re:In CPython, types implemented in C are part of the type tree
by Too on Friday December 25, 2020 @03:51AM
(#25535210)
We already have TypedPython. It's called Mypy, and any organization doing serious or larger scale Python development should already have this hooked up to their CI.
Together with Pycharm you get almost same level of fearless refactoring only C# or Java can offer.
It's a bit shocking to see people not using it or not even being aware of it's existence, because without it large codebases quickly become a steaming pile of unsafe mess.
Re:In CPython, types implemented in C are part of the type tree
by abcxjeb284 on Friday December 25, 2020 @11:37AM
(#25537381)
Agreed, strict use of mypy with editor support is a game changer (particularly its union types and TypedDict)
Maybe at some point we'll get TypedPython (like we got TypeScript).
In my opinion that's the way language design should be done.
First discover what semantic people want to use to express themselves and if you got that right enough then try to describe that semantic with a type system as rich as you need to let people express themselves more precisely.
Starting with designing typesystem is too hard and leads to fiasco that kept Haskell in obscurity and spawned whole slew of dynamic languages.
Although maybe we got better at making flexible enough type systems... Rust seems to be doing a lot of stuff right.