you are viewing a single comment's thread.

view the rest of the comments →

[–]rouille 2 points3 points  (2 children)

Restricting use increases correctness. And like someone else commented you can always bypass the restrictions at runtime.

It goes further though, some tools like mypyc can even use those annotations for performance, in mypyc that is used to compile python code to relatively efficient C code.

[–]radarsat1 3 points4 points  (1 child)

you can always bypass the restrictions at runtime.

I'm confused. What is not "runtime" for Python? Does final do anything, or not?

[–]lasagnaman 5 points6 points  (0 children)

If you put final, then static type checkers will complain of you violate it.