Open gvanrossum opened 5 years ago
This is related to https://github.com/python/mypy/issues/4157. We are going to fix this after we are done with the main part of the refactoring (i.e. soon).
Fourth, apparently mypy's own type checking doesn't catch the discrepancy between the implemented spec (only a name) and the interface spec (name + args).
This is a separate problem I think. @Michael0x2a do we already have an issue for this?
FYI: sqlmypy is hit by this api change: https://github.com/dropbox/sqlalchemy-stubs/issues/232
The plugin API defines two different interfaces (TypeAnalyzerPluginInterface and SemanticAnalyzerPluginInterface) that each define a method named_type(). These look almost identical, but looks are deceptive.
First, the specified signatures differ subtly:
Second, the implementations differ:
Third, the type checker's named_type() implementation doesn't actually take a list of type arguments at all -- it's a method with only one argument, the name to look up. It always fills in all type parameters with Any. (It looks like the method we want here is named_generic_type().)
Fourth, apparently mypy's own type checking doesn't catch the discrepancy between the implemented spec (only a name) and the interface spec (name + args).