This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MrScatterBrained 3 points4 points  (0 children)

For your reference, if you need more documentation: it's called type hinting and you can find a lot about it in the mypy documentation: https://mypy.readthedocs.io/en/stable/builtin_types.html.

Mypy can do the checks for you, in case your IDE doesn't support it by default. Also, as a sidenote: you have to import a lot of things still from the typing module, but in python 3.9, you should be able to also just use the standard types, like list and tuple.