Re:Why type hinting sucks (/r/Python)
by solarkraft on Saturday February 11, 2023 @08:36AM
(#34752202)
I think (optional) static typing is important for "serious" programming, so I've been experimenting with Python's type hints after of my good experiences with TypeScript (which fundamentally works in the same way).
Oh boy, what a mess, especially if you have to keep compatibility with 3.7 (which has slightly different types for builtins).
The ecosystem is definitely improving and I do think the benefit will eventually be worth it, but this example illustrates (albeit in a somewhat exaggerated way) why I would advise users to move cautiously.
IDE completions are a good benefit for a start, it'll probably take a while until you can support strict checking (errors when types don't match).
Oh boy, what a mess, especially if you have to keep compatibility with 3.7 (which has slightly different types for builtins).
The ecosystem is definitely improving and I do think the benefit will eventually be worth it, but this example illustrates (albeit in a somewhat exaggerated way) why I would advise users to move cautiously.
IDE completions are a good benefit for a start, it'll probably take a while until you can support strict checking (errors when types don't match).