mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
small corrections in too few argument errors
This commit is contained in:
@@ -80,7 +80,7 @@ def get_params(evaluator, func, var_args):
|
||||
# assignment, just the result. Therefore nothing has to be
|
||||
# returned.
|
||||
values = []
|
||||
if isinstance(var_args, pr.Array):
|
||||
if not keys_only and isinstance(var_args, pr.Array):
|
||||
#print(var_args, var_args.start_pos, id(var_args))
|
||||
#original_var_ars = var_args
|
||||
#if len(var_args) == 0:
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# normal arguments (no keywords)
|
||||
# -----------------
|
||||
|
||||
|
||||
def simple(a):
|
||||
return a
|
||||
|
||||
@@ -36,7 +37,13 @@ simple(1, a=1)
|
||||
def two_params(x, y):
|
||||
return y
|
||||
|
||||
|
||||
two_params(y=2, x=1)
|
||||
two_params(1, y=2)
|
||||
#! 10 type-error
|
||||
|
||||
# The next two statements should generate errors. Basically it should generate
|
||||
# something like `TypeError: x() got multiple values for keyword argument 'a'`.
|
||||
# For now however, any error should be fine.
|
||||
two_params(1, x=2)
|
||||
#! 17 type-error-too-many-arguments
|
||||
two_params(1, 2, y=3)
|
||||
|
||||
Reference in New Issue
Block a user