Skip to content

Commit 934273c

Browse files
committed
fixup: Format Python code with Black
1 parent de14b91 commit 934273c

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

mathics/builtin/assignment.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,9 @@ def assign_elementary(self, lhs, rhs, evaluation, tags=None, upset=False):
315315
# $Context = $Context <> "test`"
316316
#
317317
if new_context.startswith("`"):
318-
new_context = evaluation.definitions.get_current_context() + new_context.lstrip(
319-
"`"
318+
new_context = (
319+
evaluation.definitions.get_current_context()
320+
+ new_context.lstrip("`")
320321
)
321322

322323
evaluation.definitions.set_current_context(new_context)

mathics/builtin/files_io/importexport.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ class RegisterImport(Builtin):
10921092

10931093
def apply(self, formatname, function, posts, evaluation, options):
10941094
"""ImportExport`RegisterImport[formatname_String, function_, posts_,
1095-
OptionsPattern[ImportExport`RegisterImport]]"""
1095+
OptionsPattern[ImportExport`RegisterImport]]"""
10961096
evaluation.cache_result = False
10971097

10981098
if function.has_form("List", None):
@@ -1175,7 +1175,7 @@ class RegisterExport(Builtin):
11751175

11761176
def apply(self, formatname, function, evaluation, options):
11771177
"""ImportExport`RegisterExport[formatname_String, function_,
1178-
OptionsPattern[ImportExport`RegisterExport]]"""
1178+
OptionsPattern[ImportExport`RegisterExport]]"""
11791179

11801180
evaluation.cache_result = False
11811181
EXPORTERS[formatname.get_string_value()] = (function, options)

mathics/builtin/system.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ class ClearSystemCache(Builtin):
621621
<dt>'ClearSystemCache[]'
622622
<dd> Clears the internal system cache of expressions.
623623
</dl>
624-
624+
625625
"""
626626

627627
def apply_clear(self, evaluation):

mathics/core/evaluation.py

-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ def __init__(
267267
self.cache_eval = {}
268268
self.cache_result = False
269269

270-
271270
def parse(self, query):
272271
"Parse a single expression and print the messages."
273272
from mathics.core.parser import MathicsSingleLineFeeder

mathics/core/expression.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -1318,11 +1318,14 @@ def evaluate(self, evaluation) -> typing.Union["Expression", "Symbol"]:
13181318
# evaluation.cache_result can be set here or from inside the evaluation
13191319
# of a branch. Once it is set to false, the result is not cached,
13201320
# and hence, not used.
1321-
if evaluation.cache_result and (self.get_head_name() in (
1322-
"System`Out",
1323-
"System`ToBoxes",
1324-
"System`MakeBoxes",
1325-
)):
1321+
if evaluation.cache_result and (
1322+
self.get_head_name()
1323+
in (
1324+
"System`Out",
1325+
"System`ToBoxes",
1326+
"System`MakeBoxes",
1327+
)
1328+
):
13261329
evaluation.cache_result = False
13271330

13281331
if evaluation.cache_result:

0 commit comments

Comments
 (0)