Skip to content

Commit 6f47564

Browse files
committed
Allow "encoding" parameter to format()
1 parent 7981c00 commit 6f47564

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mathics/core/evaluation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from mathics_scanner import TranslateError
1414

1515
from mathics import settings
16-
from mathics.core.expression import ensure_context, KeyComparable, SymbolAborted, SymbolList, SymbolNull
16+
from mathics.core.expression import ensure_context, KeyComparable, SymbolAborted
1717

1818
FORMATS = [
1919
"StandardForm",
@@ -250,7 +250,7 @@ def __init__(
250250
self.format = format
251251
self.catch_interrupt = catch_interrupt
252252

253-
self.SymbolNull = SymbolNull
253+
self.SymbolNull = Symbol("Null")
254254

255255
# status of last evaluate
256256
self.exc_result = self.SymbolNull
@@ -458,7 +458,7 @@ def format_output(self, expr, format=None):
458458
def set_quiet_messages(self, messages) -> None:
459459
from mathics.core.expression import Expression
460460

461-
value = Expression(SymbolList, *messages)
461+
value = Expression("List", *messages)
462462
self.definitions.set_ownvalue("Internal`$QuietMessages", value)
463463

464464
def get_quiet_messages(self):

mathics/core/expression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def format_expr(expr):
486486
finally:
487487
evaluation.dec_recursion_depth()
488488

489-
def format(self, evaluation, form) -> typing.Union["Expression", "Symbol"]:
489+
def format(self, evaluation, form, **kwargs) -> typing.Union["Expression", "Symbol"]:
490490
"""
491491
Applies formats associated to the expression, and then calls Makeboxes
492492
"""

0 commit comments

Comments
 (0)