diff --git a/jedi/inference/value/iterable.py b/jedi/inference/value/iterable.py index 7ced0f45..ae832305 100644 --- a/jedi/inference/value/iterable.py +++ b/jedi/inference/value/iterable.py @@ -206,9 +206,6 @@ class Sequence(LazyAttributeOverwrite, IterableMixin): def py__bool__(self): return None # We don't know the length, because of appends. - def py__class__(self): - return compiled.builtin_from_name(self.inference_state, self.array_type) - @safe_property def parent(self): return self.inference_state.builtins_module diff --git a/test/completion/pep0484_overload.py b/test/completion/pep0484_overload.py index aced3728..b8df3797 100644 --- a/test/completion/pep0484_overload.py +++ b/test/completion/pep0484_overload.py @@ -4,6 +4,7 @@ from typing import List, Dict, overload lst: list list_alias: List list_str: List[str] +list_str: List[int] # ------------------------- # With base classes @@ -41,3 +42,33 @@ overload_f3(lst) overload_f3(list_alias) #? str() overload_f3(list_str) + +# ------------------------- +# Generics Matching +# ------------------------- + +@overload +def overload_f1(value: List[str]) -> str: ... + + +@overload +def overload_f1(value: Dict[str, str]) -> Dict[str, str]: ... + +def overload_f1(): + pass + +#? str() +overload_f1(['']) +#? str() dict() +overload_f1(1) +#? dict() +overload_f1({'': ''}) + +#? str() dict() +overload_f1(lst) +#? str() dict() +overload_f1(list_alias) +#? str() +overload_f1(list_str) +#? str() dict() +overload_f1(list_int)