Type Hinting - Constrain metaclass of typing.Type

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/learnpython

Our great sponsors
  • Scout APM - Less time debugging, more time building
  • SonarQube - Static code analysis for 29 languages.
  • SaaSHub - Software Alternatives and Reviews
  • mypy

    Optional static typing for Python

    Been looking into it a bit more. I think you're right, it's not supported. Turns out mypy only has very limited support for type hinting metaclasses. This page suggests it may be possible to support this with a mypy plugin, but I'm really not looking to do something that involved. Just wanting to hint an existing API :/ I suppose I could look into tweaking the API to be more hint-able, but I think I'll just accept this piece isn't perfect.

  • typing

    Python static typing home. Hosts the documentation and a user help forum.

    but looking at relevant issues on GitHub it seems this has been shot down repeatedly. python/typing#18, python/typing#213

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts