Skip to content

Match rest keyword arguments of a data class #899

@shmygol

Description

@shmygol

Isn't it possible to match the rest of data class keyword arguments similar to a dictionary?

The code below throws a parse error:

data T(a: int, b: int)
t = T(1, 2)

match T(a=arg1, **_) in t: print(arg1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions