From da4ad7fd3f860867fbbfbea27b743882a9878a9f Mon Sep 17 00:00:00 2001 From: David Halter Date: Sun, 10 Feb 2013 23:57:20 +0100 Subject: [PATCH] fix Name (instead of Param) as param key --- jedi/evaluate.py | 3 ++- jedi/evaluate_representation.py | 5 +++-- jedi/helpers.py | 3 --- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/jedi/evaluate.py b/jedi/evaluate.py index f1090a68..1adfbc3c 100644 --- a/jedi/evaluate.py +++ b/jedi/evaluate.py @@ -598,11 +598,12 @@ def follow_call_list(call_list, follow_array=False): # comprehensions result += follow_statement(stmt) else: - if isinstance(call, (pr.Lambda)): + if isinstance(call, pr.Lambda): result.append(er.Function(call)) # With things like params, these can also be functions... elif isinstance(call, (er.Function, er.Class, er.Instance, dynamic.ArrayInstance)): + # TODO this is just not very well readable -> fix, use pr.Base result.append(call) # The string tokens are just operations (+, -, etc.) elif not isinstance(call, (str, unicode)): diff --git a/jedi/evaluate_representation.py b/jedi/evaluate_representation.py index 371c76d0..db7f0957 100644 --- a/jedi/evaluate_representation.py +++ b/jedi/evaluate_representation.py @@ -305,7 +305,6 @@ class Function(use_metaclass(cache.CachedMetaClass, pr.Base)): """ Needed because of decorators. Decorators are evaluated here. """ - def __init__(self, func, is_decorated=False): """ This should not be called directly """ self.base_func = func @@ -639,7 +638,9 @@ class Execution(Executable): for key_stmt, value_stmt in array.items(): # first index, is the key if syntactically correct call = key_stmt.get_commands()[0] - if type(call) == pr.Call: + if isinstance(call, pr.Name): + yield call, value_stmt + elif type(call) == pr.Call: yield call.name, value_stmt else: # `pr`.[Call|Function|Class] lookup. diff --git a/jedi/helpers.py b/jedi/helpers.py index f97b72f6..04986497 100644 --- a/jedi/helpers.py +++ b/jedi/helpers.py @@ -55,9 +55,6 @@ def fast_parent_copy(obj): elif isinstance(el, list): copied_list[i] = list_rec(el) return copied_list - - if isinstance(obj, list): - obj = tuple(obj) return recursion(obj)