The older method is docstrings (reST and similar) like here: https://github.com/kennethreitz/requests/blob/master/request...
IDEs like PyCharm can use those and other methods to find most typing issues. In practice this is very effective for most "boring" Python code, but if you get really clever it falls over completely.