Skip to content

Parse error when passing keyword arguments after forwarding **args #2580

Closed
@z33ky

Description

@z33ky
def spam(x, y): pass

def ok(**kwargs) -> None:
    spam(x=1, **kwargs)  # OK

def err(**kwargs) -> None:
    spam(**kwargs, x=1)  # error: Parse error before "x"

I wouldn't think the order matters. The Python interpreter does not have an issue with it.

With --fast-parser I get error: "spam" gets multiple values for keyword argument "x" instead. Should I open a separate issue for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions