mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-21 03:57:05 +08:00
Ensure comprehensions and generator expressions work
This commit is contained in:
1 parent
f4cbf61604
commit
f1a9e681ad
2 files changed
+12
-2
No files matched your search
@@ -389,7 +389,7 @@ def _infer_type_vars(annotation_value, value_set, is_class_value=False):
|
|||||||
# we combine them?
|
# we combine them?
|
||||||
|
|
||||||
for element in value_set:
|
for element in value_set:
|
||||||
py_class = element.py__class__()
|
py_class = element.get_annotated_class_object()
|
||||||
if not isinstance(py_class, GenericClass):
|
if not isinstance(py_class, GenericClass):
|
||||||
py_class = element
|
py_class = element
|
||||||
|
|
||||||
@@ -444,7 +444,7 @@ def _infer_type_vars(annotation_value, value_set, is_class_value=False):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if element.is_instance():
|
if element.is_instance():
|
||||||
py_class = element.py__class__()
|
py_class = element.get_annotated_class_object()
|
||||||
else:
|
else:
|
||||||
py_class = element
|
py_class = element
|
||||||
|
|
||||||
|
|||||||
@@ -180,6 +180,16 @@ for x7 in unwrap_custom(list_custom_instances):
|
|||||||
x7
|
x7
|
||||||
|
|
||||||
|
|
||||||
|
for xc in unwrap_custom([CustomGeneric(s) for s in 'abc']):
|
||||||
|
#? str()
|
||||||
|
xc
|
||||||
|
|
||||||
|
|
||||||
|
for xg in unwrap_custom(CustomGeneric(s) for s in 'abc'):
|
||||||
|
#? str()
|
||||||
|
xg
|
||||||
|
|
||||||
|
|
||||||
# Test extraction of type from type parameer nested within a custom generic type
|
# Test extraction of type from type parameer nested within a custom generic type
|
||||||
custom_instance_list_int = CustomGeneric([42]) # type: CustomGeneric[List[int]]
|
custom_instance_list_int = CustomGeneric([42]) # type: CustomGeneric[List[int]]
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user