Files
openide/python/testData/psi/AssignmentExpressions.py
Semyon Proshev 9335c066f5 Make parser stricter for assignment expressions (PY-33886, PY-36478)
Now it more follows original python grammar.

GitOrigin-RevId: f2b45554d16ff87d946950591f0e92fedcfdfaf0
2020-11-24 17:34:59 +00:00

22 lines
349 B
Python

if a := b:
pass
while c := d:
pass
[y := 2, y**2, y**3]
[y for x in data if (y := f(x))]
len(lines := [])
foo(x := 1, cat='2')
(loc := x, y) # loc will be x, not (x, y)
(px, py, pz := position) # pz will be position, px and py are references
x = (y := z) = 'spam' # z is a reference
result_list = [a := 1]
result_list = [(a := 1)]