mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-22 21:31:26 +08:00
fix for kwargs params
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import copy
|
||||
from itertools import chain
|
||||
|
||||
from jedi._compatibility import unicode, zip_longest
|
||||
from jedi.parser import representation as pr
|
||||
@@ -132,7 +131,7 @@ def get_params(evaluator, func, var_args):
|
||||
array_type = pr.Array.DICT
|
||||
if non_matching_keys:
|
||||
keys, values = zip(*non_matching_keys)
|
||||
values = list(chain(*values))
|
||||
values = [helpers.stmts_to_stmt(list(v)) for v in values]
|
||||
non_matching_keys = []
|
||||
else:
|
||||
# normal param
|
||||
|
||||
@@ -47,5 +47,17 @@ kwargs_test(c=3)
|
||||
kwargs_test(b=2)
|
||||
#! 22 type-error-keyword-argument
|
||||
kwargs_test(b=2, c=3, d=4)
|
||||
#! 22 type-error-multiple-values
|
||||
#! 11 type-error-multiple-values
|
||||
kwargs_test(b=2, c=3, a=4)
|
||||
|
||||
|
||||
def kwargs_nested(**kwargs):
|
||||
return kwargs_test(b=2, **kwargs)
|
||||
|
||||
kwargs_nested(c=3)
|
||||
#! 13 type-error-too-few-arguments
|
||||
kwargs_nested()
|
||||
#! 19 type-error-keyword-argument
|
||||
kwargs_nested(c=2, d=4)
|
||||
#! 13 type-error-multiple-values
|
||||
kwargs_nested(c=2, a=4)
|
||||
|
||||
Reference in New Issue
Block a user