Python 3.7: check if type annotation is “subclass” of generic
First of all: There is no API defined to introspect type hinting objects as defined by the typing module. Type hinting tools are expected to deal with source code, so text, not with Python objects at runtime; mypy doesn’t introspect List[str] objects, it instead deals a parsed Abstract Syntax Tree of your source code. So, … Read more