This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
*args should be a tuple (not a list) #1239
Open
Description
Running:
def func(a, b=123, *args, **kwargs):
print("a", type(a))
print("b",type(b))
print("args", type(args))
print("kwargs", type(kwargs))
x = [1, 2, 3]
y = {"foo": 3.141}
func("foo", *x, **y)
Gives:
a <class 'str'>
b <class 'int'>
args <class 'tuple'>
kwargs <class 'dict'>
We are missing type info on both args and kwargs. The latter is #1238, but we have some places where args
is assumed to be list
, when it should be tuple
. It's always tuple
, and does not depend on what happened to be unpacked into it.