4 ms·
Python has had type hints for like... Oh 11 years now. Just like C# has introduced var and quicker ways to write less, to the point it almost looks like JavaScr
by giancarlostoro 6mo ago
Python has had type hints for like... Oh 11 years now. Just like C# has introduced var and quicker ways to write less, to the point it almost looks like JavaScript sometimes, but its because we can infer types pretty easily now. Rust has a nice system as well, forcing method signatures to declare types, everything is easier to infer from this.
Introduced in 3.5 (2015)
https://docs.python.org/3/library/typing.html https://docs.python.org/3/library/typing.html
- deepsun 6mo agoYet many projects don't use them. Sometimes they are wrong (as they are more like a comment than a compiler directive). My first task in any project was to figure out why devs don't have error highlighting on for bad types (often it's "it was red so we turned it off"), but good luck forcing others who don't do type hunting to start doing it when "it slows us down".
- giancarlostoro 6mo agoI guess I'm spoiled in that I've done both Python and C# throughout my carreer.
- spprashant 6mo agoHaving type hints as a feature is not the same as using them.