Skip to content

Commit 054779a

Browse files
committed
rocky comments. Instancable->Instanceable
1 parent 338894c commit 054779a

7 files changed

Lines changed: 172 additions & 142 deletions

File tree

mathics/builtin/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def get_option_string(self, *params):
362362
return None, s
363363

364364

365-
class InstancableBuiltin(Builtin):
365+
class InstanceableBuiltin(Builtin):
366366
def __new__(cls, *args, **kwargs):
367367
new_kwargs = kwargs.copy()
368368
new_kwargs["expression"] = False
@@ -375,7 +375,7 @@ def __new__(cls, *args, **kwargs):
375375
try:
376376
instance.init(*args, **kwargs)
377377
except TypeError:
378-
# TypeError occurs when unpickling instance, e.g. PatterObject,
378+
# TypeError occurs when unpickling instance, e.g. PatternObject,
379379
# because parameter expr is not given. This should no be a
380380
# problem, as pickled objects need their init-method not
381381
# being called.
@@ -590,14 +590,14 @@ class BoxConstructError(Exception):
590590
pass
591591

592592

593-
class BoxConstruct(InstancableBuiltin):
593+
class BoxConstruct(InstanceableBuiltin):
594594
def __new__(cls, *leaves, **kwargs):
595595
instance = super().__new__(cls, *leaves, **kwargs)
596596
instance._leaves = leaves
597597
return instance
598598

599599
def evaluate(self, evaluation):
600-
# Shall here evaluate the leaves?
600+
# THINK about: Should we evaluate the leaves here?
601601
return
602602

603603
def get_head_name(self):
@@ -707,7 +707,7 @@ def __init__(self, name, count, expected):
707707
super().__init__(None, None)
708708

709709

710-
class PatternObject(InstancableBuiltin, Pattern):
710+
class PatternObject(InstanceableBuiltin, Pattern):
711711
needs_verbatim = True
712712

713713
arg_counts: typing.List[int] = []

mathics/builtin/graphics.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from mathics.builtin.base import (
1616
Builtin,
17-
InstancableBuiltin,
17+
InstanceableBuiltin,
1818
BoxConstruct,
1919
BoxConstructError,
2020
)
@@ -508,15 +508,14 @@ def convert(content):
508508
for option in options:
509509
if option not in ("System`ImageSize",):
510510
options[option] = Expression("N", options[option]).evaluate(evaluation)
511-
#box_name = "Graphics" + self.box_suffix
512511
from mathics.builtin.graphics3d import Graphics3DBox, Graphics3D
513512
if type(self) is Graphics:
514513
return GraphicsBox(convert(content), *options_to_rules(options))
515514
elif type(self) is Graphics3D:
516515
return Graphics3DBox(convert(content), *options_to_rules(options))
517516

518517

519-
class _GraphicsElement(InstancableBuiltin):
518+
class _GraphicsElement(InstanceableBuiltin):
520519
def init(self, graphics, item=None, style=None):
521520
if item is not None and not item.has_form(self.get_name(), None):
522521
raise BoxConstructError
@@ -3205,8 +3204,6 @@ def boxes_to_tex(self, leaves=None, **options):
32053204
def boxes_to_xml(self, leaves=None, **options):
32063205
if not leaves:
32073206
leaves = self._leaves
3208-
evaluation = options.get("evaluation", None)
3209-
32103207
elements, calc_dimensions = self._prepare_elements(leaves, options, neg_y=True)
32113208

32123209
xmin, xmax, ymin, ymax, w, h, width, height = calc_dimensions()

mathics/builtin/graphics3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import numbers
1010
from mathics.core.expression import Expression, from_python, system_symbols_dict
11-
from mathics.builtin.base import BoxConstructError, Builtin, InstancableBuiltin
11+
from mathics.builtin.base import BoxConstructError, Builtin, InstanceableBuiltin
1212
from .graphics import (
1313
Graphics,
1414
GraphicsBox,
@@ -1130,7 +1130,7 @@ def apply_min(self, xmin, ymin, zmin, evaluation):
11301130
return self.apply_full(xmin, ymin, zmin, xmax, ymax, zmax, evaluation)
11311131

11321132

1133-
class _Graphics3DElement(InstancableBuiltin):
1133+
class _Graphics3DElement(InstanceableBuiltin):
11341134
def init(self, graphics, item=None, style=None):
11351135
if item is not None and not item.has_form(self.get_name(), None):
11361136
raise BoxConstructError

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
onload = loaded_module.pymathics_version_data.get("onload", None)
163163
if onload:
164164
onload(self)
165-
165+
166166
return loaded_module
167167

168168
def clear_pymathics_modules(self):
5 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)