Skip to content

Need to spell out syntax for a, b, *c = ... # type: ... #363

@gvanrossum

Description

@gvanrossum

In analogy to the syntax for *args in function definitions, mypy's old parser requires:

a, b, *c = 0, 0  # type: int, int, *List[int]

but the new parser omits the star from the annotation:

a, b, *c = 0, 0  # type: int, int, List[int]

The PEP doesn't say which it should be. I propose the latter (since the analogy with function definitions is flawed anyway -- it would have to be *int).

See also https://github.com/python/mypy/pull/2722/files

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