1
0
forked from VimPlug/jedi

Ensure specialised types inheriting from generics work

This commit is contained in:
Peter Law
2020-02-22 23:10:27 +00:00
parent e455709a31
commit c15e0ef9b8
2 changed files with 65 additions and 5 deletions
+3 -5
View File
@@ -438,14 +438,12 @@ def _infer_type_vars(annotation_value, value_set, is_class_value=False):
else:
py_class = element
# TODO: what about things like 'str', which likely aren't
# generic, but do implement 'Iterable[str]'?
if not isinstance(py_class, DefineGenericBase):
continue
for klass in py_class.py__mro__():
class_name = klass.py__name__()
if annotation_name == class_name:
if not isinstance(klass, DefineGenericBase):
continue
annotation_generics = annotation_value.get_generics()
actual_generics = klass.get_generics()