Commit efc045e
authored
Assignment expression targets can only be identifiers. From the
[grammar](https://docs.python.org/3.14/reference/grammar.html):
```
assignment_expression:
| NAME ':=' ~ expression
```
This
[corresponds](https://github.com/python/typeshed/blob/ac8f2632ec37bb4a82ade0906e6ce9bdb33883d3/stdlib/ast.pyi#L834-L837)
to the standard library AST node's `target` type:
```python
class NamedExpr(expr):
if sys.version_info >= (3, 10):
__match_args__ = ("target", "value")
target: Name
```
1 parent b1ac028 commit efc045e
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2075 | 2075 | | |
2076 | 2076 | | |
2077 | 2077 | | |
2078 | | - | |
| 2078 | + | |
2079 | 2079 | | |
2080 | 2080 | | |
2081 | 2081 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
| 562 | + | |
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
| |||
0 commit comments