-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-138294: Fix Misleading error for ((a) := 1) #138627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
185ce34
d9c911e
bb95d1f
84fbba0
7eb3d1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -2852,6 +2852,11 @@ def test_assign_del(self): | |||
| # report "cannot delete name" | ||||
| self._check_error("del a += b", "invalid syntax") | ||||
|
|
||||
| def test_parenthesized_named_expression_target(self): | ||||
| self._check_error( | ||||
| "((a) := 1)", | ||||
| "cannot parenthesize target name in assignment expression") | ||||
|
|
||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it'd be best if this went in the docstring at the top of the file instead of a separate test. It can probably go at the very bottom of that docstring with a short description of the error being tested, something along the lines of
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dbXD320 You can add a new section like this: cpython/Lib/test/test_syntax.py Line 2471 in 921f61b
|
||||
| def test_global_param_err_first(self): | ||||
| source = """if 1: | ||||
| def error(a): | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Raise an improved :exc:`SyntaxError` when using parentheses around a walrus target. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.