mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Create separate classes for FakeSequence
This commit is contained in:
@@ -253,8 +253,8 @@ def _execute_array_values(inference_state, array):
|
||||
Tuples indicate that there's not just one return value, but the listed
|
||||
ones. `(str, int)` means that it returns a tuple with both types.
|
||||
"""
|
||||
from jedi.inference.value.iterable import SequenceLiteralValue, FakeSequence
|
||||
if isinstance(array, SequenceLiteralValue):
|
||||
from jedi.inference.value.iterable import SequenceLiteralValue, FakeTuple, FakeList
|
||||
if isinstance(array, SequenceLiteralValue) and array.array_type in ('tuple', 'list'):
|
||||
values = []
|
||||
for lazy_value in array.py__iter__():
|
||||
objects = ValueSet.from_sets(
|
||||
@@ -262,7 +262,8 @@ def _execute_array_values(inference_state, array):
|
||||
for typ in lazy_value.infer()
|
||||
)
|
||||
values.append(LazyKnownValues(objects))
|
||||
return {FakeSequence(inference_state, array.array_type, values)}
|
||||
cls = FakeTuple if array.array_type == 'tuple' else FakeList
|
||||
return {cls(inference_state, values)}
|
||||
else:
|
||||
return array.execute_annotation()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user