small corrections in too few argument errors

This commit is contained in:
Dave Halter
2014-05-26 17:38:14 +02:00
parent 425f7a8b64
commit 720907531b
2 changed files with 9 additions and 2 deletions

View File

@@ -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:

View File

@@ -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)