mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-19 03:55:57 +08:00
More fixes for arrays.
This commit is contained in:
@@ -247,9 +247,9 @@ class ArrayMixin(object):
|
|||||||
|
|
||||||
def get_filters(self, search_global, until_position=None, origin_scope=None):
|
def get_filters(self, search_global, until_position=None, origin_scope=None):
|
||||||
# `array.type` is a string with the type, e.g. 'list'.
|
# `array.type` is a string with the type, e.g. 'list'.
|
||||||
scope = compiled.builtin_from_name(self._evaluator, self.type)
|
compiled_obj = compiled.builtin_from_name(self._evaluator, self.array_type)
|
||||||
for typ in self._evaluator.execute_evaluated(scope, self):
|
for typ in compiled_obj.execute_evaluated(self):
|
||||||
for filter in scope.get_filters():
|
for filter in typ.get_filters():
|
||||||
yield filter
|
yield filter
|
||||||
# TODO this should be used.
|
# TODO this should be used.
|
||||||
#yield DictFilter(self._get_names_dict(names_dicts[1]))
|
#yield DictFilter(self._get_names_dict(names_dicts[1]))
|
||||||
@@ -264,10 +264,6 @@ class ArrayMixin(object):
|
|||||||
def parent(self):
|
def parent(self):
|
||||||
return self._evaluator.BUILTINS
|
return self._evaluator.BUILTINS
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
return FakeSequence(self._evaluator, [], self.type).name
|
|
||||||
|
|
||||||
def dict_values(self):
|
def dict_values(self):
|
||||||
return unite(self._evaluator.eval_element(v) for k, v in self._items())
|
return unite(self._evaluator.eval_element(v) for k, v in self._items())
|
||||||
|
|
||||||
@@ -339,7 +335,7 @@ class GeneratorComprehension(Comprehension, GeneratorMixin):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ArrayLiteralContext(AbstractSequence, ArrayMixin):
|
class ArrayLiteralContext(ArrayMixin, AbstractSequence):
|
||||||
mapping = {'(': 'tuple',
|
mapping = {'(': 'tuple',
|
||||||
'[': 'list',
|
'[': 'list',
|
||||||
'{': 'dict'}
|
'{': 'dict'}
|
||||||
|
|||||||
Reference in New Issue
Block a user