pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/mypy/wiki/Unsupported-Python-Features

ous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-f638bd26ec06210f.css" /> Unsupported Python Features · python/mypy Wiki · GitHub
Skip to content

Unsupported Python Features

Phoenix edited this page Oct 16, 2024 · 8 revisions

Some Python features are not currently supported by mypy.

It should be relatively easy to add support for these features:

  • Double underscore name mangling in classes (you can use double underscores but the names are not treated as special)

The features in the list below are more difficult to support. Many of these could be supported, at least in a restricted form, but some will likely remain unsupported.

  • Metaclasses
    • Mypy understands simple metaclasses, i.e. it performs attribute and method lookup
    • Mypy plugin mechanism allows mypy to understand specific metaclasses
  • Class decorators that modify a class
    • Similar to metaclasses
  • Run-time evaluated base classes like class A(foo()): pass
    • Similar to metaclasses
  • Run-time addition/mutation of base classes (e.g. registering ABCs)
  • Runtime mutation of classes and modules (runtime definition of new methods/functions, etc.)
  • Conditional definition of classes (e.g. within if statement)
  • Certain idioms involving conditional imports
  • __all__ with complex initializer / mutated value
  • eval and exec (these can be used but they are opaque to the type checker)

If your code uses any of the above unsupported features and is causing errors when mypy checks your code, you can bypass it by adding # type: ignore to the line that causes the error.

Clone this wiki locally

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy