Skip to content

Commit

Permalink
Merge pull request #690 from Mathics3/Symbol-init-cleanup_2
Browse files Browse the repository at this point in the history
alternative implementation for MakeBoxes[Infix[...],format]
  • Loading branch information
rocky authored Dec 27, 2022
2 parents 9e286fd + 827b8b8 commit 64f42cd
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 222 deletions.
6 changes: 3 additions & 3 deletions mathics/builtin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
mathics_to_python,
)
from mathics.core.pattern import pattern_objects
from mathics.core.symbols import Symbol
from mathics.eval.makeboxes import builtins_precedence
from mathics.settings import ENABLE_FILES_MODULE
from mathics.version import __version__ # noqa used in loading to check consistency.

Expand All @@ -60,7 +62,7 @@ def add_builtins(new_builtins):
# print("XXX1", sympy_name)
sympy_to_mathics[sympy_name] = builtin
if isinstance(builtin, Operator):
builtins_precedence[name] = builtin.precedence
builtins_precedence[Symbol(name)] = builtin.precedence
if isinstance(builtin, PatternObject):
pattern_objects[name] = builtin.__class__
_builtins.update(dict(new_builtins))
Expand Down Expand Up @@ -236,8 +238,6 @@ def name_is_builtin_symbol(module, name: str) -> Optional[type]:
mathics_to_sympy = {} # here we have: name -> sympy object
sympy_to_mathics = {}

builtins_precedence = {}

new_builtins = _builtins_list

# FIXME: some magic is going on here..
Expand Down
Loading

0 comments on commit 64f42cd

Please sign in to comment.