black/tests/data/pep_572_py39.py
Richard Si 366a0806eb
blib2to3: support unparenthesized wulruses in more places (#2447)
Implementation stolen from PR davidhalter/parso#162. Thanks parso!

I could add support for these newer syntactical constructs in the
target version detection logic, but until I get diff-shades up
and running I don't feel very comfortable adding the code.
2021-08-26 13:59:01 -07:00

8 lines
253 B
Python

# Unparenthesized walruses are now allowed in set literals & set comprehensions
# since Python 3.9
{x := 1, 2, 3}
{x4 := x ** 5 for x in range(7)}
# We better not remove the parentheses here (since it's a 3.10 feature)
x[(a := 1)]
x[(a := 1), (b := 3)]