Skip to content

Commit ab2923d

Browse files
committed
all: Update Python formatting to latest Black version 22.1.0.
Signed-off-by: Damien George <[email protected]>
1 parent 326b2c7 commit ab2923d

16 files changed

+83
-83
lines changed

examples/rp2/pio_pwm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ def set(self, value):
4141

4242
while True:
4343
for i in range(256):
44-
pwm.set(i ** 2)
44+
pwm.set(i**2)
4545
sleep(0.01)

tests/cpydiff/modules_random_randint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
import random
99

1010

11-
x = random.randint(2 ** 128 - 1, 2 ** 128)
11+
x = random.randint(2**128 - 1, 2**128)
1212
print("x={}".format(x))

tests/float/complex1.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
print(1j / 2)
2828
print((1j / 2j).real)
2929
print(1j / (1 + 2j))
30-
ans = 0j ** 0
30+
ans = 0j**0
3131
print("%.5g %.5g" % (ans.real, ans.imag))
32-
ans = 0j ** 1
32+
ans = 0j**1
3333
print("%.5g %.5g" % (ans.real, ans.imag))
34-
ans = 0j ** 0j
34+
ans = 0j**0j
3535
print("%.5g %.5g" % (ans.real, ans.imag))
36-
ans = 1j ** 2.5
36+
ans = 1j**2.5
3737
print("%.5g %.5g" % (ans.real, ans.imag))
38-
ans = 1j ** 2.5j
38+
ans = 1j**2.5j
3939
print("%.5g %.5g" % (ans.real, ans.imag))
4040

4141
# comparison
@@ -116,10 +116,10 @@
116116

117117
# zero division via power
118118
try:
119-
0j ** -1
119+
0j**-1
120120
except ZeroDivisionError:
121121
print("ZeroDivisionError")
122122
try:
123-
0j ** 1j
123+
0j**1j
124124
except ZeroDivisionError:
125125
print("ZeroDivisionError")

tests/float/float1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
print("ZeroDivisionError")
8989

9090
try:
91-
0.0 ** -1
91+
0.0**-1
9292
except ZeroDivisionError:
9393
print("ZeroDivisionError")
9494

tests/float/float2int_doubleprec_intbig.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@
3535
print(int(1418774543.0))
3636
print("%d" % 1418774543.0)
3737
if ll_type == 3:
38-
print(int(2.0 ** 100))
39-
print("%d" % 2.0 ** 100)
38+
print(int(2.0**100))
39+
print("%d" % 2.0**100)
4040
else:
4141
print(int(1073741823.0))
4242
print("%d" % 1073741823.0)
4343

4444
testpass = True
4545
p2_rng = ((30, 63, 1024), (62, 63, 1024))[is_64bit][ll_type]
4646
for i in range(0, p2_rng):
47-
bitcnt = len(bin(int(2.0 ** i))) - 3
47+
bitcnt = len(bin(int(2.0**i))) - 3
4848
if i != bitcnt:
4949
print("fail: 2**%u was %u bits long" % (i, bitcnt))
5050
testpass = False
@@ -53,7 +53,7 @@
5353
testpass = True
5454
p10_rng = ((9, 18, 23), (18, 18, 23))[is_64bit][ll_type]
5555
for i in range(0, p10_rng):
56-
digcnt = len(str(int(10.0 ** i))) - 1
56+
digcnt = len(str(int(10.0**i))) - 1
5757
if i != digcnt:
5858
print("fail: 10**%u was %u digits long" % (i, digcnt))
5959
testpass = False
@@ -72,28 +72,28 @@ def fp2int_test(num, name, should_fail):
7272
if ll_type != 2:
7373
if ll_type == 0:
7474
if is_64bit:
75-
neg_bad_fp = -1.00000005 * 2.0 ** 62.0
76-
pos_bad_fp = 2.0 ** 62.0
77-
neg_good_fp = -(2.0 ** 62.0)
78-
pos_good_fp = 0.99999993 * 2.0 ** 62.0
75+
neg_bad_fp = -1.00000005 * 2.0**62.0
76+
pos_bad_fp = 2.0**62.0
77+
neg_good_fp = -(2.0**62.0)
78+
pos_good_fp = 0.99999993 * 2.0**62.0
7979
else:
80-
neg_bad_fp = -1.00000005 * 2.0 ** 30.0
81-
pos_bad_fp = 2.0 ** 30.0
82-
neg_good_fp = -(2.0 ** 30.0)
83-
pos_good_fp = 0.9999999499 * 2.0 ** 30.0
80+
neg_bad_fp = -1.00000005 * 2.0**30.0
81+
pos_bad_fp = 2.0**30.0
82+
neg_good_fp = -(2.0**30.0)
83+
pos_good_fp = 0.9999999499 * 2.0**30.0
8484
else:
85-
neg_bad_fp = -0.51 * 2.0 ** 64.0
86-
pos_bad_fp = 2.0 ** 63.0
87-
neg_good_fp = -(2.0 ** 63.0)
88-
pos_good_fp = 1.9999998 * 2.0 ** 62.0
85+
neg_bad_fp = -0.51 * 2.0**64.0
86+
pos_bad_fp = 2.0**63.0
87+
neg_good_fp = -(2.0**63.0)
88+
pos_good_fp = 1.9999998 * 2.0**62.0
8989

9090
fp2int_test(neg_bad_fp, "neg bad", True)
9191
fp2int_test(pos_bad_fp, "pos bad", True)
9292
fp2int_test(neg_good_fp, "neg good", False)
9393
fp2int_test(pos_good_fp, "pos good", False)
9494
else:
95-
fp2int_test(-1.9999999999999981 * 2.0 ** 1023.0, "large neg", False)
96-
fp2int_test(1.9999999999999981 * 2.0 ** 1023.0, "large pos", False)
95+
fp2int_test(-1.9999999999999981 * 2.0**1023.0, "large neg", False)
96+
fp2int_test(1.9999999999999981 * 2.0**1023.0, "large pos", False)
9797

9898
fp2int_test(float("inf"), "inf test", True)
9999
fp2int_test(float("-inf"), "inf test", True)

tests/float/float2int_fp30_intbig.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
print(int(14187744.0))
3535
print("%d" % 14187744.0)
3636
if ll_type == 2:
37-
print(int(2.0 ** 100))
38-
print("%d" % 2.0 ** 100)
37+
print(int(2.0**100))
38+
print("%d" % 2.0**100)
3939

4040
testpass = True
4141
p2_rng = ((30, 63, 127), (62, 63, 127))[is_64bit][ll_type]
4242
for i in range(0, p2_rng):
43-
bitcnt = len(bin(int(2.0 ** i))) - 3
43+
bitcnt = len(bin(int(2.0**i))) - 3
4444
if i != bitcnt:
4545
print("fail: 2.**%u was %u bits long" % (i, bitcnt))
4646
testpass = False
@@ -50,7 +50,7 @@
5050
testpass = True
5151
p10_rng = 9
5252
for i in range(0, p10_rng):
53-
digcnt = len(str(int(10.0 ** i))) - 1
53+
digcnt = len(str(int(10.0**i))) - 1
5454
if i != digcnt:
5555
print("fail: 10.**%u was %u digits long" % (i, digcnt))
5656
testpass = False
@@ -69,28 +69,28 @@ def fp2int_test(num, name, should_fail):
6969
if ll_type != 2:
7070
if ll_type == 0:
7171
if is_64bit:
72-
neg_bad_fp = -1.00000005 * 2.0 ** 62.0
73-
pos_bad_fp = 2.0 ** 62.0
74-
neg_good_fp = -(2.0 ** 62.0)
75-
pos_good_fp = 0.99999993 * 2.0 ** 62.0
72+
neg_bad_fp = -1.00000005 * 2.0**62.0
73+
pos_bad_fp = 2.0**62.0
74+
neg_good_fp = -(2.0**62.0)
75+
pos_good_fp = 0.99999993 * 2.0**62.0
7676
else:
77-
neg_bad_fp = -1.00000005 * 2.0 ** 30.0
78-
pos_bad_fp = 2.0 ** 30.0
79-
neg_good_fp = -(2.0 ** 30.0)
80-
pos_good_fp = 0.9999999499 * 2.0 ** 30.0
77+
neg_bad_fp = -1.00000005 * 2.0**30.0
78+
pos_bad_fp = 2.0**30.0
79+
neg_good_fp = -(2.0**30.0)
80+
pos_good_fp = 0.9999999499 * 2.0**30.0
8181
else:
82-
neg_bad_fp = -0.51 * 2.0 ** 64.0
83-
pos_bad_fp = 2.0 ** 63.0
84-
neg_good_fp = -(2.0 ** 63.0)
85-
pos_good_fp = 1.9999998 * 2.0 ** 62.0
82+
neg_bad_fp = -0.51 * 2.0**64.0
83+
pos_bad_fp = 2.0**63.0
84+
neg_good_fp = -(2.0**63.0)
85+
pos_good_fp = 1.9999998 * 2.0**62.0
8686

8787
fp2int_test(neg_bad_fp, "neg bad", True)
8888
fp2int_test(pos_bad_fp, "pos bad", True)
8989
fp2int_test(neg_good_fp, "neg good", False)
9090
fp2int_test(pos_good_fp, "pos good", False)
9191
else:
92-
fp2int_test(-1.999999879 * 2.0 ** 126.0, "large neg", False)
93-
fp2int_test(1.999999879 * 2.0 ** 126.0, "large pos", False)
92+
fp2int_test(-1.999999879 * 2.0**126.0, "large neg", False)
93+
fp2int_test(1.999999879 * 2.0**126.0, "large pos", False)
9494

9595
fp2int_test(float("inf"), "inf test", True)
9696
fp2int_test(float("-inf"), "inf test", True)

tests/float/float2int_intbig.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737
print("%d" % 14187745.)
3838
# fmt: on
3939
if ll_type == 2:
40-
print(int(2.0 ** 100))
41-
print("%d" % 2.0 ** 100)
40+
print(int(2.0**100))
41+
print("%d" % 2.0**100)
4242

4343
testpass = True
4444
p2_rng = ((30, 63, 127), (62, 63, 127))[is_64bit][ll_type]
4545
for i in range(0, p2_rng):
46-
bitcnt = len(bin(int(2.0 ** i))) - 3
46+
bitcnt = len(bin(int(2.0**i))) - 3
4747
if i != bitcnt:
4848
print("fail: 2.**%u was %u bits long" % (i, bitcnt))
4949
testpass = False
@@ -53,7 +53,7 @@
5353
testpass = True
5454
p10_rng = 9 if (ll_type == 0 and ~is_64bit) else 11
5555
for i in range(0, p10_rng):
56-
digcnt = len(str(int(10.0 ** i))) - 1
56+
digcnt = len(str(int(10.0**i))) - 1
5757
if i != digcnt:
5858
print("fail: 10.**%u was %u digits long" % (i, digcnt))
5959
testpass = False
@@ -72,28 +72,28 @@ def fp2int_test(num, name, should_fail):
7272
if ll_type != 2:
7373
if ll_type == 0:
7474
if is_64bit:
75-
neg_bad_fp = -1.00000005 * 2.0 ** 62.0
76-
pos_bad_fp = 2.0 ** 62.0
77-
neg_good_fp = -(2.0 ** 62.0)
78-
pos_good_fp = 0.99999993 * 2.0 ** 62.0
75+
neg_bad_fp = -1.00000005 * 2.0**62.0
76+
pos_bad_fp = 2.0**62.0
77+
neg_good_fp = -(2.0**62.0)
78+
pos_good_fp = 0.99999993 * 2.0**62.0
7979
else:
80-
neg_bad_fp = -1.00000005 * 2.0 ** 30.0
81-
pos_bad_fp = 2.0 ** 30.0
82-
neg_good_fp = -(2.0 ** 30.0)
83-
pos_good_fp = 0.9999999499 * 2.0 ** 30.0
80+
neg_bad_fp = -1.00000005 * 2.0**30.0
81+
pos_bad_fp = 2.0**30.0
82+
neg_good_fp = -(2.0**30.0)
83+
pos_good_fp = 0.9999999499 * 2.0**30.0
8484
else:
85-
neg_bad_fp = -0.51 * 2.0 ** 64.0
86-
pos_bad_fp = 2.0 ** 63.0
87-
neg_good_fp = -(2.0 ** 63.0)
88-
pos_good_fp = 1.9999998 * 2.0 ** 62.0
85+
neg_bad_fp = -0.51 * 2.0**64.0
86+
pos_bad_fp = 2.0**63.0
87+
neg_good_fp = -(2.0**63.0)
88+
pos_good_fp = 1.9999998 * 2.0**62.0
8989

9090
fp2int_test(neg_bad_fp, "neg bad", True)
9191
fp2int_test(pos_bad_fp, "pos bad", True)
9292
fp2int_test(neg_good_fp, "neg good", False)
9393
fp2int_test(pos_good_fp, "pos good", False)
9494
else:
95-
fp2int_test(-1.999999879 * 2.0 ** 127.0, "large neg", False)
96-
fp2int_test(1.999999879 * 2.0 ** 127.0, "large pos", False)
95+
fp2int_test(-1.999999879 * 2.0**127.0, "large neg", False)
96+
fp2int_test(1.999999879 * 2.0**127.0, "large pos", False)
9797

9898
fp2int_test(float("inf"), "inf test", True)
9999
fp2int_test(float("nan"), "NaN test", True)

tests/float/inf_nan_arith.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
except ZeroDivisionError:
1515
print(" / ZeroDivisionError")
1616
try:
17-
print(" ** pow", x ** y, pow(x, y))
17+
print(" ** pow", x**y, pow(x, y))
1818
except ZeroDivisionError:
1919
print(" ** pow ZeroDivisionError")
2020
print(" == != < <= > >=", x == y, x != y, x < y, x <= y, x > y, x >= y)

tests/float/int_big_float.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
print("%.5g" % (i * 1.2j).imag)
2020

2121
# negative power should produce float
22-
print("%.5g" % (i ** -1))
22+
print("%.5g" % (i**-1))
2323
print("%.5g" % ((2 + i - i) ** -3))
2424

2525
try:

tests/float/int_divzero.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
print("ZeroDivisionError")
55

66
try:
7-
0 ** -1
7+
0**-1
88
except ZeroDivisionError:
99
print("ZeroDivisionError")

0 commit comments

Comments
 (0)