mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-30 16:54:20 +08:00
Better filter for arrays.
This commit is contained in:
@@ -242,9 +242,17 @@ class ArrayMixin(object):
|
||||
# builtins only have one class -> [0]
|
||||
scopes = self._evaluator.execute_evaluated(scope, self)
|
||||
names_dicts = list(scopes)[0].names_dicts(search_global)
|
||||
#yield names_dicts[0]
|
||||
yield self._get_names_dict(names_dicts[1])
|
||||
|
||||
def get_filters(self, search_global, until_position=None, origin_scope=None):
|
||||
# `array.type` is a string with the type, e.g. 'list'.
|
||||
scope = compiled.builtin_from_name(self._evaluator, self.type)
|
||||
for typ in self._evaluator.execute_evaluated(scope, self):
|
||||
for filter in scope.get_filters():
|
||||
yield filter
|
||||
# TODO this should be used.
|
||||
#yield DictFilter(self._get_names_dict(names_dicts[1]))
|
||||
|
||||
def py__bool__(self):
|
||||
return None # We don't know the length, because of appends.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user