Skip to content

Incorrect type of starred argument in function definition #511

Closed
@spkersten

Description

@spkersten

The type of the starred argument is incorrectly inferred to be a List instead of a Tuple. For example:

def f(*y: int) -> None:
    p = 1, 2
    p = y

mypy incorrectly reports:

line 3: Incompatible types in assignment (expression has type List[int], variable has type "Tuple[int, int]")

See documentation.

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