2 ms·
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 T
by solarkraft 4y ago
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).
- satya71 4y agoFor compatibility, use typing_extensions. You can use most of the latest typing features with older versions of Python.