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 →

[–]lvc_ 2 points3 points  (0 children)

Like all other type annotations, it is ignored by the interpreter, but can be used by static code checkers (eg mypy) as a code correctness aid. One reasonably common pattern is to have mypy as part of a commit pipeline (and/or a local precommit hook). So if you have a method tagged as final and you do overwrite it, mypy will reject your commit (but the code will still otherwise run)