Skip to content

Commit 959935e

Browse files
authored
black weirdness wars (#1015)
In some versions, black seems to want optional "," at the end of the last parameter. In support of getting #1013 to build cleanly
1 parent 8436347 commit 959935e

17 files changed

Lines changed: 38 additions & 38 deletions

File tree

mathics/builtin/colors/color_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def result():
454454
yield to_expression(
455455
Symbol(out_palette_head),
456456
*prototype,
457-
elements_conversion_fn=MachineReal
457+
elements_conversion_fn=MachineReal,
458458
)
459459

460460
return to_mathics_list(*itertools.islice(result(), 0, at_most))

mathics/builtin/drawing/plot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ def eval(
654654
functions,
655655
xexpr_limits,
656656
yexpr_limits,
657-
*options_to_rules(options)
657+
*options_to_rules(options),
658658
)
659659

660660
functions = self.get_functions_param(functions)
@@ -1501,7 +1501,7 @@ def final_graphics(self, graphics, options):
15011501
return Expression(
15021502
SymbolGraphics,
15031503
ListExpression(*graphics),
1504-
*options_to_rules(options, Graphics.options)
1504+
*options_to_rules(options, Graphics.options),
15051505
)
15061506

15071507

@@ -1936,7 +1936,7 @@ def auto_bins():
19361936
return Expression(
19371937
SymbolGraphics,
19381938
ListExpression(*graphics),
1939-
*options_to_rules(options, Graphics.options)
1939+
*options_to_rules(options, Graphics.options),
19401940
)
19411941

19421942

@@ -2622,5 +2622,5 @@ def final_graphics(self, graphics, options: dict):
26222622
return Expression(
26232623
SymbolGraphics3D,
26242624
ListExpression(*graphics),
2625-
*options_to_rules(options, Graphics3D.options)
2625+
*options_to_rules(options, Graphics3D.options),
26262626
)

mathics/builtin/fileformats/htmlformat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def xml_object(tree):
8080
return Expression(
8181
Expression(SymbolXMLObject, String("Document")),
8282
to_mathics_list(*declaration),
83-
*node_to_xml_element(tree.getroot())
83+
*node_to_xml_element(tree.getroot()),
8484
)
8585

8686

mathics/builtin/fileformats/xmlformat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def xml_object(root):
143143
return Expression(
144144
to_expression("XMLObject", String("Document")),
145145
to_mathics_list(*declaration),
146-
*node_to_xml_element(root)
146+
*node_to_xml_element(root),
147147
)
148148

149149

mathics/builtin/files_io/importexport.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,7 +1825,7 @@ def eval_elements(self, filename, expr, elems, evaluation, options={}):
18251825
exporter_symbol,
18261826
filename,
18271827
expr,
1828-
*list(chain(stream_options, custom_options))
1828+
*list(chain(stream_options, custom_options)),
18291829
)
18301830
res = exporter_function.evaluate(evaluation)
18311831
elif function_channels == ListExpression(String("Streams")):
@@ -1840,7 +1840,7 @@ def eval_elements(self, filename, expr, elems, evaluation, options={}):
18401840
exporter_symbol,
18411841
stream,
18421842
expr,
1843-
*list(chain(stream_options, custom_options))
1843+
*list(chain(stream_options, custom_options)),
18441844
)
18451845
res = exporter_function.evaluate(evaluation)
18461846
Expression(SymbolClose, stream).evaluate(evaluation)
@@ -1967,7 +1967,7 @@ def eval_elements(self, expr, elems, evaluation: Evaluation, **options):
19671967
exporter_symbol,
19681968
filename,
19691969
expr,
1970-
*list(chain(stream_options, custom_options))
1970+
*list(chain(stream_options, custom_options)),
19711971
)
19721972
exportres = exporter_function.evaluate(evaluation)
19731973
if exportres != SymbolNull:
@@ -2013,7 +2013,7 @@ def eval_elements(self, expr, elems, evaluation: Evaluation, **options):
20132013
exporter_symbol,
20142014
outstream,
20152015
expr,
2016-
*list(chain(stream_options, custom_options))
2016+
*list(chain(stream_options, custom_options)),
20172017
)
20182018
res = exporter_function.evaluate(evaluation)
20192019
if res is SymbolNull:

mathics/builtin/inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def evaluate_predicate(pred, evaluation):
359359
if pred.has_form(("List", "Sequence"), None):
360360
return Expression(
361361
pred._head,
362-
*[evaluate_predicate(subp, evaluation) for subp in pred.elements]
362+
*[evaluate_predicate(subp, evaluation) for subp in pred.elements],
363363
)
364364

365365
debug_logical_expr("reducing ", pred, evaluation)

mathics/builtin/numbers/algebra.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ def eval_list(self, polys, varlist, evaluation: Evaluation, options: dict):
845845
SymbolTable,
846846
Integer(0),
847847
ListExpression(Integer(dim1)),
848-
*its2
848+
*its2,
849849
)
850850
else:
851851
newtable = Expression(SymbolTable, Integer(0), *its2)
@@ -952,7 +952,7 @@ def eval(self, expr, form, evaluation):
952952
self.__class__.__name__, expr, form, Integer(n), evaluation
953953
)
954954
for n in range(dimensions[0] + 1)
955-
]
955+
],
956956
)
957957
elif form.has_form("List", 1):
958958
form = form.elements[0]
@@ -963,7 +963,7 @@ def eval(self, expr, form, evaluation):
963963
self.__class__.__name__, expr, form, Integer(n), evaluation
964964
)
965965
for n in range(dimensions[0] + 1)
966-
]
966+
],
967967
)
968968
else:
969969

mathics/builtin/numbers/diffeqns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def eval(self, eqn, y, x, evaluation: Evaluation):
160160
Expression(
161161
SymbolFunction,
162162
function_form,
163-
*from_sympy(soln).elements[1:]
163+
*from_sympy(soln).elements[1:],
164164
),
165165
),
166166
)

mathics/builtin/patterns.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ def match(
11191119
head=None,
11201120
element_index=None,
11211121
element_count=None,
1122-
**kwargs
1122+
**kwargs,
11231123
):
11241124
if expression.has_form("Sequence", 0):
11251125
if self.default is None:
@@ -1231,7 +1231,7 @@ def match(
12311231
expression: Expression,
12321232
vars: dict,
12331233
evaluation: Evaluation,
1234-
**kwargs
1234+
**kwargs,
12351235
):
12361236
if not expression.has_form("Sequence", 0):
12371237
if self.head is not None:
@@ -1286,7 +1286,7 @@ def match(
12861286
expression: Expression,
12871287
vars: dict,
12881288
evaluation: Evaluation,
1289-
**kwargs
1289+
**kwargs,
12901290
):
12911291
elements = expression.get_sequence()
12921292
if not elements:
@@ -1335,7 +1335,7 @@ def match(
13351335
expression: Expression,
13361336
vars: dict,
13371337
evaluation: Evaluation,
1338-
**kwargs
1338+
**kwargs,
13391339
):
13401340
elements = expression.get_sequence()
13411341
if self.head:
@@ -1553,7 +1553,7 @@ def match(
15531553
expression: Expression,
15541554
vars: dict,
15551555
evaluation: Evaluation,
1556-
**kwargs
1556+
**kwargs,
15571557
):
15581558
# for new_vars, rest in self.pattern.match(expression, vars,
15591559
# evaluation):
@@ -1626,7 +1626,7 @@ def match(
16261626
expression: Expression,
16271627
vars: dict,
16281628
evaluation: Evaluation,
1629-
**kwargs
1629+
**kwargs,
16301630
):
16311631
if self.defaults is None:
16321632
self.defaults = kwargs.get("head")

mathics/builtin/pympler/asizeof.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,7 +2390,7 @@ def print_largest(self, w=0, cutoff=0, **print3options):
23902390
self._ranked,
23912391
s,
23922392
_SI(s),
2393-
**print3options
2393+
**print3options,
23942394
)
23952395
id2x = dict((r.id, i) for i, r in enumerate(self._ranks))
23962396
for r in self._ranks[:n]:
@@ -2428,7 +2428,7 @@ def print_profiles(self, w=0, cutoff=0, **print3options):
24282428
_plural(len(t)),
24292429
s,
24302430
self._incl,
2431-
**print3options
2431+
**print3options,
24322432
)
24332433
r = len(t)
24342434
for v, k in sorted(t, reverse=True):
@@ -2498,7 +2498,7 @@ def print_stats(
24982498
_SI(z),
24992499
self._incl,
25002500
self._repr(o),
2501-
**print3options
2501+
**print3options,
25022502
)
25032503
else:
25042504
if objs:
@@ -2531,7 +2531,7 @@ def print_summary(self, w=0, objs=(), **print3options):
25312531
self._total,
25322532
_SI(self._total),
25332533
self._incl,
2534-
**print3options
2534+
**print3options,
25352535
)
25362536
if self._mask:
25372537
self._printf("%*d byte aligned", w, self._mask + 1, **print3options)
@@ -2581,7 +2581,7 @@ def print_typedefs(self, w=0, **print3options):
25812581
len(t),
25822582
k,
25832583
_plural(len(t)),
2584-
**print3options
2584+
**print3options,
25852585
)
25862586
for a, v in sorted(t):
25872587
self._printf("%*s %s: %s", w, "", a, v, **print3options)
@@ -2612,7 +2612,7 @@ def reset(
26122612
limit=100,
26132613
stats=0,
26142614
stream=None,
2615-
**extra
2615+
**extra,
26162616
):
26172617
"""Reset sizing options, state, etc. to defaults.
26182618

0 commit comments

Comments
 (0)