From b27f47683c3346a9bb250d275dc5d01ef58b66ac Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 4 Sep 2019 00:08:49 +0200 Subject: [PATCH] get_first_non_keyword_argument_values is not really used anymore --- jedi/inference/syntax_tree.py | 14 -------------- jedi/inference/value/instance.py | 7 ------- 2 files changed, 21 deletions(-) diff --git a/jedi/inference/syntax_tree.py b/jedi/inference/syntax_tree.py index b4e0820b..fe007f32 100644 --- a/jedi/inference/syntax_tree.py +++ b/jedi/inference/syntax_tree.py @@ -265,20 +265,6 @@ def infer_atom(context, atom): @_limit_value_infers def infer_expr_stmt(context, stmt, seek_name=None): with recursion.execution_allowed(context.inference_state, stmt) as allowed: - # Here we allow list/set to recurse under certain conditions. To make - # it possible to resolve stuff like list(set(list(x))), this is - # necessary. - if not allowed and context.get_root_context().is_builtins_module(): - try: - instance = context.arguments.instance - except AttributeError: - pass - else: - if instance.name.string_name in ('list', 'set'): - c = instance.get_first_non_keyword_argument_values() - if instance not in c: - allowed = True - if allowed: return _infer_expr_stmt(context, stmt, seek_name) return NO_VALUES diff --git a/jedi/inference/value/instance.py b/jedi/inference/value/instance.py index b908aee2..35439477 100644 --- a/jedi/inference/value/instance.py +++ b/jedi/inference/value/instance.py @@ -130,13 +130,6 @@ class CompiledInstance(AbstractInstanceValue): def name(self): return compiled.CompiledValueName(self, self.class_value.name.string_name) - def get_first_non_keyword_argument_values(self): - key, lazy_value = next(self.arguments.unpack(), ('', None)) - if key is not None: - return NO_VALUES - - return lazy_value.infer() - def is_stub(self): return False