52
52
functions = dict (
53
53
[
54
54
(
55
- f' { y .__name__ } ({ ", " .join (repr (v ) if isinstance (v , str ) else v .__name__ for v in w )} )' ,
55
+ f" { y .__name__ } ({ ', ' .join (repr (v ) if isinstance (v , str ) else v .__name__ for v in w )} )" ,
56
56
z [0 ],
57
57
)
58
58
for x , y in inspect .getmembers (
63
63
]
64
64
+ [
65
65
(
66
- f' { y .__name__ } ({ ", " .join (repr (v ) if isinstance (v , str ) else v .__name__ for v in w )} )' ,
66
+ f" { y .__name__ } ({ ', ' .join (repr (v ) if isinstance (v , str ) else v .__name__ for v in w )} )" ,
67
67
z [0 ],
68
68
)
69
69
for x , y in inspect .getmembers (
74
74
]
75
75
+ [
76
76
(
77
- f' { y .__name__ } ({ ", " .join (repr (v ) if isinstance (v , str ) else v .__name__ for v in w )} )' ,
77
+ f" { y .__name__ } ({ ', ' .join (repr (v ) if isinstance (v , str ) else v .__name__ for v in w )} )" ,
78
78
z [0 ],
79
79
)
80
80
for x , y in inspect .getmembers (
@@ -158,9 +158,9 @@ def analyze_assignment(node, context):
158
158
assert node .kind == "sstmt"
159
159
assert len (node ) == 1
160
160
161
- assert (
162
- node [ 0 ]. kind == "assign "
163
- ), "only assignments and a final 'return' are allowed (and not tuple-assignment)"
161
+ assert node [ 0 ]. kind == "assign" , (
162
+ "only assignments and a final 'return' are allowed (and not tuple-assignment) "
163
+ )
164
164
assert len (node [0 ]) == 2
165
165
assert node [0 ][1 ].kind == "store"
166
166
@@ -264,9 +264,9 @@ def analyze_expression(node, context):
264
264
analyze_expression (expr (node [0 ][0 ]), context )
265
265
analyze_expression (expr (node [0 ][1 ]), context )
266
266
assert node [0 ][2 ].kind == "COMPARE_OP"
267
- assert (
268
- node [0 ][2 ].attr in allowed_comparisons
269
- ), f"add { node [ 0 ][ 2 ]. attr !r } to allowed_comparisons"
267
+ assert node [ 0 ][ 2 ]. attr in allowed_comparisons , (
268
+ f"add { node [0 ][2 ].attr !r } to allowed_comparisons"
269
+ )
270
270
271
271
elif node .kind == "call" :
272
272
assert len (node ) >= 2
@@ -290,15 +290,15 @@ def analyze_expression(node, context):
290
290
291
291
292
292
def analyze_unary_operator (node , context ):
293
- assert (
294
- node .kind in allowed_unary_operators
295
- ), f"add { node . kind !r } to allowed_unary_operators"
293
+ assert node . kind in allowed_unary_operators , (
294
+ f"add { node .kind !r } to allowed_unary_operators"
295
+ )
296
296
297
297
298
298
def analyze_binary_operator (node , context ):
299
- assert (
300
- node .kind in allowed_binary_operators
301
- ), f"add { node . kind !r } to allowed_binary_operators"
299
+ assert node . kind in allowed_binary_operators , (
300
+ f"add { node .kind !r } to allowed_binary_operators"
301
+ )
302
302
303
303
304
304
def analyze_callable (node , context ):
@@ -309,9 +309,9 @@ def analyze_callable(node, context):
309
309
assert node [1 ].kind == "LOAD_METHOD"
310
310
311
311
if module .attr == "lib" :
312
- assert (
313
- node [1 ].attr in allowed_lib_functions
314
- ), f"add { node [ 1 ]. attr !r } to allowed_lib_functions"
312
+ assert node [ 1 ]. attr in allowed_lib_functions , (
313
+ f"add { node [1 ].attr !r } to allowed_lib_functions"
314
+ )
315
315
316
316
else :
317
317
module_name = "." .join (
0 commit comments