mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Fix error when using generators with variable-length arguments
This commit is contained in:
@@ -29,6 +29,8 @@ def try_iter_content(types, depth=0):
|
||||
|
||||
class AbstractArguments(object):
|
||||
context = None
|
||||
argument_node = None
|
||||
trailer = None
|
||||
|
||||
def eval_argument_clinic(self, parameters):
|
||||
"""Uses a list with argument clinic information (see PEP 436)."""
|
||||
@@ -197,7 +199,11 @@ class TreeArguments(AbstractArguments):
|
||||
arguments = param.var_args
|
||||
break
|
||||
|
||||
return [arguments.argument_node or arguments.trailer]
|
||||
if arguments.argument_node:
|
||||
return [arguments.argument_node]
|
||||
if arguments.trailer:
|
||||
return [arguments.trailer]
|
||||
return []
|
||||
|
||||
|
||||
class ValuesArguments(AbstractArguments):
|
||||
|
||||
@@ -211,6 +211,17 @@ class X():
|
||||
#?
|
||||
self.x()
|
||||
|
||||
|
||||
def decorator_var_args(function, *args):
|
||||
return function(*args)
|
||||
|
||||
@decorator_var_args
|
||||
def function_var_args(param):
|
||||
return param
|
||||
|
||||
#? int()
|
||||
function_var_args(1)
|
||||
|
||||
# -----------------
|
||||
# method decorators
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user