From 18a10c436f0d69c5ec972c8b9d87b6299e2e3053 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 6 Dec 2015 03:16:21 +0100 Subject: [PATCH] Simplify names_dict lookups for Arrays. --- jedi/evaluate/iterable.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jedi/evaluate/iterable.py b/jedi/evaluate/iterable.py index 05bb1ed8..42ba251e 100644 --- a/jedi/evaluate/iterable.py +++ b/jedi/evaluate/iterable.py @@ -185,10 +185,10 @@ class ArrayMixin(object): @memoize_default() def names_dicts(self, search_global=False): # Always False. # `array.type` is a string with the type, e.g. 'list'. - scope = list(self._evaluator.find_types(compiled.builtin, self.type))[0] + scope = compiled.builtin.get_by_name(self.type) # builtins only have one class -> [0] - scope = list(self._evaluator.execute(scope, (AlreadyEvaluated((self,)),)))[0] - return scope.names_dicts(search_global) + scopes = self._evaluator.execute_evaluated(scope, self) + return list(scopes)[0].names_dicts(search_global) def py__bool__(self): return None # We don't know the length, because of appends.