Skip to content

Type checker rejects call with both *args and a keyword arg #153

Closed
@JukkaL

Description

@JukkaL

The following code is not accepted by the type checker, even though it's arguably valid:

def f(a, x=1): pass
f(*[1], x=2)   # Error: multiple values for keyword argument "x"

The type checker should probably not complain about multiple argument values if one of the values is from a *arg.

The limitation can be worked around by replacing keyword args with dict args (**args).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions