Skip to content

Commit f8c6cb0

Browse files
committed
merge master
1 parent f15b642 commit f8c6cb0

6 files changed

Lines changed: 9 additions & 17 deletions

File tree

mathics/builtin/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def is_builtin(var):
8585
mathics_to_python = {} # here we have: name -> string
8686
sympy_to_mathics = {}
8787

88-
# box_constructs = {}
8988
pattern_objects = {}
9089
builtins_precedence = {}
9190

@@ -101,9 +100,6 @@ def add_builtins(new_builtins):
101100
mathics_to_sympy[name] = builtin
102101
for sympy_name in builtin.get_sympy_names():
103102
sympy_to_mathics[sympy_name] = builtin
104-
# if isinstance(builtin, BoxConstruct):
105-
# box_constructs[name] = builtin
106-
# print("BC ", name)
107103
if isinstance(builtin, Operator):
108104
builtins_precedence[name] = builtin.precedence
109105
if isinstance(builtin, PatternObject):

mathics/builtin/base.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def has_option(options, name, evaluation):
6060

6161
class Builtin(object):
6262
name: typing.Optional[str] = None
63-
# context = "System`"
6463
context = ""
6564
abstract = False
6665
attributes: typing.Tuple[Any, ...] = ()
@@ -621,13 +620,13 @@ def same(self, expr):
621620

622621
def is_atom(self):
623622
return False
624-
623+
625624
def do_format(self, evaluation, format):
626625
return self
627-
626+
628627
def format(self, evaluation, fmt):
629628
return self
630-
629+
631630
def get_head(self):
632631
return Symbol(self.get_name())
633632

@@ -646,7 +645,7 @@ def leaves(self):
646645
@leaves.setter
647646
def leaves(self, value):
648647
raise ValueError('BoxConstruct.leaves is write protected.')
649-
648+
650649
# I need to repeat this, because this is not
651650
# an expression...
652651
def has_form(self, heads, *leaf_counts):
@@ -680,9 +679,6 @@ def has_form(self, heads, *leaf_counts):
680679
def flatten_pattern_sequence(self, evaluation) -> 'BoxConstruct':
681680
return self
682681

683-
# def get_name(self):
684-
685-
686682
def get_option_values(self, leaves, **options):
687683
evaluation = options.get("evaluation", None)
688684
if evaluation:

mathics/builtin/compilation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def boxes_to_xml(self, leaves=None, **options):
168168

169169
def boxes_to_tex(self, leaves=None, **options):
170170
if not leaves:
171-
leaves = self._leaves
171+
leaves = self._leaves
172172
return '-CompiledCode-'
173173

174174

mathics/builtin/graphics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2941,7 +2941,7 @@ class GraphicsBox(BoxConstruct):
29412941
def boxes_to_text(self, leaves=None, **options):
29422942
if not leaves:
29432943
leaves = self._leaves
2944-
2944+
29452945
self._prepare_elements(leaves, options) # to test for Box errors
29462946
return "-Graphics-"
29472947

mathics/core/definitions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def load_pymathics_module(self, module, remove_on_quit=True):
162162
if remove_on_quit and name not in self.pymathics:
163163
self.pymathics[name] = self.builtin.get(name, None)
164164
self.builtin.update(newsymbols)
165-
165+
166166
for name, item in newsymbols.items():
167167
if name != "System`MakeBoxes":
168168
item.contribute(self, is_pymodule=True)

mathics/core/expression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def format_expr(expr):
434434
if result is not None and result != expr:
435435
return result.evaluate(evaluation)
436436
return None
437-
437+
438438
formatted = format_expr(expr)
439439
if formatted is not None:
440440
result = formatted.do_format(evaluation, form)
@@ -664,7 +664,7 @@ class Expression(BaseExpression):
664664
_sequences: Any
665665

666666
def __new__(cls, head, *leaves, **kwargs) -> 'Expression':
667-
self = super(Expression, cls).__new__(cls)
667+
self = super(Expression, cls).__new__(cls)
668668
if isinstance(head, str):
669669
head = Symbol(head)
670670
self._head = head

0 commit comments

Comments
 (0)