4 ms·
> You can use type annotations, either via the builtin lib or 3rd party libs! > https://docs.python.org/3/library/typing.html https://docs.python.org/3/library
by fhood 8y ago
> You can use type annotations, either via the builtin lib or 3rd party libs!
> https://docs.python.org/3/library/typing.html https://docs.python.org/3/library/typing.html
I know, but tragically, because I am not forced to, I never do. I do appreciate that feature though. Maybe this will be the impetus I need to start taking advantage of it.
- computerfriend 8y agoI started doing this about a year ago and it has made me a better Python developer. Getting into the habit of always writing a type annotation was hard at first, but you quickly get used to it. It helps if you configure mypy to complain at you if the annotations are missing.
- dharmab 8y agoIf you're starting a new project you can force yourself by running mypy's strict mode in CI.
- lmm 8y agoYou'll have a much better experience in an ecosystem where typing is the widespread expectation, IME. Try an ML-family language if you haven't already - I find they combine the best parts of something like Python and something like Java. There was a post pushing F# earlier today.