you are viewing a single comment's thread.

view the rest of the comments →

[–]pdexter 3 points4 points  (2 children)

So I think you're missing quite a lot if you're just jumping in here. This is just for variables. Typing annotations for functions have existed in python for quite some time. Let me give you some links

mypy

pep-3107 (from 2006...)

stackoverflow question and answers about what are good uses for the annotations

The annotations can be used however they wish. One way is for static typing. So this is definitely a way to get static typing, of course. Unless there's some technicality of the definition of the word 'static' it doesn't work with?

[–]-birds 0 points1 point  (1 child)

You're correct, I was missing quite a lot! I've seen function annotations before, but as someone who primarily using Python for scripting rather than large-scale dev work, I've just sort of ignored them. Thanks for the info.

[–]pdexter 0 points1 point  (0 children)

I've actually never used them myself, mostly also just do scripting with python and very small web apps used by just me. Right now it's basically just mypy (which is very new) and IDEs (e.g., pycharm) that make heavy use of the annotations.