From 1cdeee65191acc4b68400508263af027e763d716 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 5 Jan 2020 02:35:27 +0100 Subject: [PATCH] Ignore processing param names, fixes #520 --- jedi/inference/dynamic_params.py | 5 +---- jedi/inference/star_args.py | 9 +++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/jedi/inference/dynamic_params.py b/jedi/inference/dynamic_params.py index 9e82a281..e37c442e 100644 --- a/jedi/inference/dynamic_params.py +++ b/jedi/inference/dynamic_params.py @@ -24,7 +24,7 @@ from jedi.inference.cache import inference_state_method_cache from jedi.inference import imports from jedi.inference.arguments import TreeArguments from jedi.inference.param import get_executed_param_names -from jedi.inference.helpers import is_stdlib_path, is_big_annoying_library +from jedi.inference.helpers import is_stdlib_path from jedi.inference.utils import to_list from jedi.inference.value import instance from jedi.inference.base_value import ValueSet, NO_VALUES @@ -67,9 +67,6 @@ def dynamic_param_lookup(function_value, param_index): have to look for all calls to ``func`` to find out what ``foo`` possibly is. """ - if is_big_annoying_library(function_value.parent_context): - return NO_VALUES - funcdef = function_value.tree_node if not settings.dynamic_params: diff --git a/jedi/inference/star_args.py b/jedi/inference/star_args.py index 519cde0c..176fd9d6 100644 --- a/jedi/inference/star_args.py +++ b/jedi/inference/star_args.py @@ -14,6 +14,7 @@ The signature here for bar should be `bar(b, c)` instead of bar(*args). from jedi._compatibility import Parameter from jedi.inference.utils import to_list from jedi.inference.names import ParamNameWrapper +from jedi.inference.helpers import is_big_annoying_library def _iter_nodes_for_param(param_name): @@ -93,6 +94,14 @@ def _remove_given_params(arguments, param_names): @to_list def process_params(param_names, star_count=3): # default means both * and ** + if param_names: + if is_big_annoying_library(param_names[0].parent_context): + # At first this feature can look innocent, but it does a lot of + # type inference in some cases, so we just ditch it. + for p in param_names: + yield p + return + used_names = set() arg_callables = [] kwarg_callables = []