Files
openide/python/testData/psi/InvalidAssignmentExpressions.py
Semyon Proshev 121f06d991 Avoid parsing RHS of assignment expression as target (PY-33886, PY-36479)
GitOrigin-RevId: 127743a6386b8155ba131fa7f249c761598880e1
2019-08-13 17:04:49 +03:00

15 lines
277 B
Python

# Parenthesis everywhere because
# unparenthesized assignment expressions are prohibited
# at the top level of an expression statement
(x := y := z := 0)
(a[i] := x)
(self.rest := [])
(p: Optional[int] := None)
(b := -)
(x := )
x = (b[j] := z) = 'spam' # z is a reference