E506 mypy/docs/source/supported_python_features.rst at master · mschoettle/mypy · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 937 Bytes

File metadata and controls

20 lines (16 loc) · 937 Bytes

Supported Python features

A list of unsupported Python features is maintained in the mypy wiki:

Runtime definition of methods and functions

By default, mypy will complain if you add a function to a class or module outside its definition -- but only if this is visible to the type checker. This only affects static checking, as mypy performs no additional type checking at runtime. You can easily work around this. For example, you can use dynamically typed code or values with Any types, or you can use :py:func:`setattr` or other introspection features. However, you need to be careful if you decide to do this. If used indiscriminately, you may have difficulty using static typing effectively, since the type checker cannot see functions defined at runtime.

0