forked from VimPlug/jedi
Fix an issue with the default type of memoize_default nt being a set.
This commit is contained in:
@@ -476,7 +476,7 @@ def check_array_additions(evaluator, array):
|
||||
return _check_array_additions(evaluator, array, current_module, is_list)
|
||||
|
||||
|
||||
@memoize_default([], evaluator_is_first_arg=True)
|
||||
@memoize_default(default=set(), evaluator_is_first_arg=True)
|
||||
@debug.increase_indent
|
||||
def _check_array_additions(evaluator, compare_array, module, is_list):
|
||||
"""
|
||||
|
||||
@@ -18,7 +18,7 @@ def recursion_decorator(func):
|
||||
rec_detect = evaluator.recursion_detector
|
||||
# print stmt, len(self.node_statements())
|
||||
if rec_detect.push_stmt(stmt):
|
||||
return []
|
||||
return set()
|
||||
else:
|
||||
result = func(evaluator, stmt, *args, **kwargs)
|
||||
rec_detect.pop_stmt()
|
||||
@@ -119,7 +119,7 @@ class ExecutionRecursionDetector(object):
|
||||
debug.dbg('Execution recursions: %s', execution, self.recursion_level,
|
||||
self.execution_count, len(self.execution_funcs))
|
||||
if self.check_recursion(execution):
|
||||
result = []
|
||||
result = set()
|
||||
else:
|
||||
result = self.func(execution)
|
||||
self.pop_execution()
|
||||
|
||||
@@ -609,7 +609,7 @@ class FunctionExecution(Executed):
|
||||
self.children = new_func.children
|
||||
self.names_dict = new_func.names_dict
|
||||
|
||||
@memoize_default(default=())
|
||||
@memoize_default(default=set())
|
||||
@recursion.execution_recursion_decorator
|
||||
def get_return_types(self, check_yields=False):
|
||||
func = self.base
|
||||
@@ -644,6 +644,7 @@ class FunctionExecution(Executed):
|
||||
break
|
||||
return types
|
||||
|
||||
# TODO add execution_recursion_decorator
|
||||
def get_yield_types(self):
|
||||
yields = self.yields
|
||||
stopAt = tree.ForStmt, tree.WhileStmt, FunctionExecution
|
||||
@@ -679,7 +680,7 @@ class FunctionExecution(Executed):
|
||||
yield evaluator.eval_element(yield_.children[1])
|
||||
else:
|
||||
for_types = evaluator.eval_element(for_stmt.get_input_node())
|
||||
ordered = iterable.ordered_elements_of_iterable(evaluator, for_types, [])
|
||||
ordered = iterable.ordered_elements_of_iterable(evaluator, for_types, set())
|
||||
for index_types in ordered:
|
||||
dct = {str(for_stmt.children[1]): index_types}
|
||||
evaluator.predefined_if_name_dict_dict[for_stmt] = dct
|
||||
|
||||
Reference in New Issue
Block a user