I\'m working with a large existing Python codebase and would like to start adding in type annotations so I can get some level of static checking. I\'m imagining something l
There is the 'gradual' package for Python 3; see PIP or the Bitbucket Repo
Apparently this is an implementation by the group around Jeremy Siek who seems to be quite an authority in the field of gradual typing.
Some annotations are apparently necessary, here is an example:
from gradual import *
@typed
def calculate_total(a:int, b:int) -> int:
return a + b//100
As far as annotations go, this is not so bad. I have not used the package so I cannot speak to its quality, but the syntax (and the people behind it) certainly make it look promising.