Skip to content

UP044 false positive around PEP 692 TypedDict **kwargs type hints #14047

@kkom

Description

@kkom

Since ruff 0.7.2 the code below:

class KwargsDict(TypedDict):
    foo: int
    bar: int

def fun(
    **kwargs: Unpack[KwargsDict],
) -> None: ...

Triggers this error:

UP044 [*] Use `*` for unpacking

I don't think the star syntax is allowed in this case though, see: https://peps.python.org/pep-0692/#introducing-a-new-syntax

And making this change triggers another Ruff error:

SyntaxError: Starred expression cannot be used here Ruff

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpreviewRelated to preview mode features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions