black/tests/data/percent_precedence.py
David Szotten d1ad8730e3
don't strip brackets before lsqb (#1575) (#1590)
if the string contains a PERCENT, it's not safe to remove brackets that
follow and operator with the same or higher precedence than PERCENT
2020-08-13 19:20:46 -07:00

40 lines
453 B
Python

("" % a) ** 2
("" % a)[0]
("" % a)()
("" % a).b
2 * ("" % a)
2 @ ("" % a)
2 / ("" % a)
2 // ("" % a)
2 % ("" % a)
+("" % a)
b + ("" % a)
-("" % a)
b - ("" % a)
~("" % a)
2 ** ("" % a)
await ("" % a)
b[("" % a)]
b(("" % a))
# output
("" % a) ** 2
("" % a)[0]
("" % a)()
("" % a).b
2 * ("" % a)
2 @ ("" % a)
2 / ("" % a)
2 // ("" % a)
2 % ("" % a)
+("" % a)
b + "" % a
-("" % a)
b - "" % a
~("" % a)
2 ** ("" % a)
await ("" % a)
b[("" % a)]
b(("" % a))