Skip to content

parameter-already-assigned when unpacking list in function call #1584

@Castavo

Description

@Castavo

Summary

When unpacking a list inside a function call, it seems as though ty interprets it as filling up all arguments available in the function.

The following :

def test(l1: str, l2: str, other: float):
    ...

test(*["a", "b"], other=0.1)

(Also found in playground)

Gives both invalid-argument-type and parameter-already-assigned.

I would have expected ty to be more lenient here: trust the keyword assignment of other, and then fill the rest of the arguments with the unpacked list

Version

7a739d6b7

Metadata

Metadata

Assignees

Labels

callsIssues relating to call-signature checking and diagnostics

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions