Closed
Description
This spawned off #1553. The mapping of argument type from a call site to a function definition is complicated by the existence of *args
, **kwds
, optional args, and keyword-only args.
For example, Python 3.5+ support multiple *args
in a call! (But not in a definition.) So this (valid) code gives two errors while there should be none:
def f(*a: int) -> int: return sum(a)
f(*[1, 2, 3], *[4, 5], 6) # E: Too many arguments for "f"
f(*(1, 2, 3), *(4, 5), 6) # E: Too many arguments for "f"
(It also doesn't give a SyntaxError with --python-version=3.4
as it should.)
Metadata
Metadata
Assignees
Labels
No labels