With PEP 484, Python now has a standard for adding type declarations to your programs. What checks these declarations, and how? I present one of the options, pytype, which Google has been working on for the last two years.
(default, Apr 12 2016, 11:08:00) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import typing >>> def make_announcement(emails: typing.List[str]) -> None: ... return emails ... >>> make_announcement("foo") 'foo' does not throw an error!
Incorrect function calls ◦ too many arguments ◦ too few arguments ◦ invalid keyword arguments ◦ invalid argument types • Invalid attribute access • Missing modules • Unsupported operands for operators • etc.