Skip to content

Commit

Permalink
Ignore processing param names, fixes #520
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhalter committed Jan 5, 2020
1 parent cc1664c commit 1cdeee6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 1 addition & 4 deletions jedi/inference/dynamic_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def foo(bar):
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
Expand Down Expand Up @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions jedi/inference/star_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def 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):
Expand Down Expand Up @@ -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 = []
Expand Down

0 comments on commit 1cdeee6

Please sign in to comment.