mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
Now it more follows original python grammar. GitOrigin-RevId: f2b45554d16ff87d946950591f0e92fedcfdfaf0
8 lines
546 B
Python
8 lines
546 B
Python
<error descr="Unparenthesized assignment expressions are prohibited at the top level of an expression statement">y := f(x)</error> # INVALID
|
|
(y := f(x)) # Valid, though not recommended
|
|
|
|
y0 = <error descr="Unparenthesized assignment expressions are prohibited at the top level of the right hand side of an assignment statement">y1 := f(x)</error> # INVALID
|
|
y0 = (y1 := f(x)) # Valid, though discouraged
|
|
|
|
class A:
|
|
[<error descr="Assignment expressions within a comprehension cannot be used in a class body">y := i</error> for i in range(2)] |