typing.TYPE_CHECKER
object to change types depending on which type checker is being run
#1337
Labels
topic: feature
Discussions about new features for Python's type annotations
One issue I have run into as a library dev is varying support for typing features or bugs for both of the type checkers.
typing.TYPE_CHECKER
would allow me to change type definition based on the type checker so that I can support all static analysis tools more effectively.I propose that
TYPE_CHECKER
would be a dict with a "name" and "version" key. Type checkers could also optionally add other keys/values.Using it for types would look like this:
At runtime I think the
TYPE_CHECKER
object should be an empty dictionary.The text was updated successfully, but these errors were encountered: