temporary very unfinished solution for the *args/**kwargs combination problem, if they are used in common with dynamic params. This doesn't solve the issue entirely, but it's at least a start and will probably solve all autocompletion issues. However, static analysis needs a little bit more than that.

This commit is contained in:
Dave Halter
2014-06-04 17:18:09 +02:00
parent 945888a535
commit acb4959a6a
4 changed files with 61 additions and 12 deletions

View File

@@ -61,3 +61,35 @@ kwargs_nested()
kwargs_nested(c=2, d=4)
#! 13 type-error-multiple-values
kwargs_nested(c=2, a=4)
# -----------------
# mixed *args/**kwargs
# -----------------
def simple_mixed(a, b, c):
return b
def mixed(*args, **kwargs):
return simple_mixed(1, *args, **kwargs)
mixed(1, 2)
mixed(1, c=2)
mixed(b=2, c=3)
mixed(c=4, b='')
# need separate functions, otherwise these might swallow the errors
def mixed2(*args, **kwargs):
return simple_mixed(1, *args, **kwargs)
#! 6 type-error-too-few-arguments
mixed2(c=2)
#! 6 type-error-too-few-arguments
mixed2(3)
#! 13 type-error-too-many-arguments
mixed2(3, 4, 5)
#! 13 type-error-too-many-arguments
mixed2(3, 4, c=5)
#! 6 type-error-multiple-values
mixed2(3, b=5)