Files
openide/python/testData/resolve/AssignmentExpressionsAndOuterVar.py
Semyon Proshev 17dd3b8981 Update scopes processing for assignment expressions (PEP 572) (PY-33886)
From the PEP:
an assignment expression occurring in
a list, set or dict comprehension or in a generator expression
binds the target in the containing scope.

GitOrigin-RevId: 88d701a8da298a9b0bdd8c7ac4d4940a5a22f9db
2019-07-02 06:52:16 +03:00

4 lines
107 B
Python

total = 0
partial_sums = [total := total + v for v in values]
print("Total:", total)
<ref>