Skip to content

Using multiple starred targets on the left side of = gets the error message saying "starred expressions" instead of "starred targets" #138275

@hyperkai

Description

@hyperkai

Bug report

Bug description:

The doc says starred target as shown below:

*Memo:

If the target list contains one target prefixed with an asterisk, called a “starred” target:

But using multiple starred targets on the left side of = gets the error message saying starred expressions instead of starred targets as shown below:

*v1, *v2, *v3 = [0, 1, 2, 3, 4]
# Error

SyntaxError: multiple starred expressions in assignment

So, the error message should say starred targets as shown below:

SyntaxError: multiple starred targets in assignment

And, using a single starred target on the left side of = gets the error message saying starred assignment target as shown below:

*v = [0, 1, 2, 3, 4]

SyntaxError: starred assignment target must be in a list or tuple

So, the error message should say starred target as shown below:

SyntaxError: starred target must be in a list or tuple in assignment

CPython versions tested on:

3.12

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions