
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.
8 lines
253 B
Python
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)]
|