Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Misleading error for ((a) := 1) #138294

Open
Open
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs) topic-parser type-bugAn unexpected behavior, bug, or error
@serhiy-storchaka

Description

Bug report

>>> ((a) := 1)
 File "<python-input-0>", line 1
 ((a) := 1)
 ^
SyntaxError: cannot use assignment expressions with name

Of course, it can. You only need to remove parentheses around the name.

>>> (a := 1)
1

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /