Skip to content

Commit 80928e0

Browse files
authored
Merge pull request #1213 from mathics/SymbolList
Singletonize Symbol System`List
2 parents 5a78087 + b85de06 commit 80928e0

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

mathics/builtin/arithmetic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
SymbolNull,
4040
SymbolSequence,
4141
SymbolTrue,
42+
SymbolSequence,
43+
from_python,
4244
from_mpmath,
4345
from_python,
4446
)

mathics/builtin/inout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
PrecisionReal,
3838
SymbolList,
3939
SymbolMakeBoxes,
40-
SymbolRule,
40+
SymbolRule
4141
)
4242
from mathics.core.numbers import (
4343
dps,

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
16+
from mathics.core.expression import ensure_context, KeyComparable, SymbolAborted, SymbolList, SymbolNull
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 = Symbol("Null")
253+
self.SymbolNull = SymbolNull
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("List", *messages)
461+
value = Expression(SymbolList, *messages)
462462
self.definitions.set_ownvalue("Internal`$QuietMessages", value)
463463

464464
def get_quiet_messages(self):

mathics/core/expression.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,6 +2024,15 @@ def __getnewargs__(self):
20242024
SymbolRule = Symbol("Rule")
20252025
SymbolSequence = Symbol("Sequence")
20262026
SymbolTrue = Symbol("True")
2027+
SymbolAborted = Symbol("$Aborted")
2028+
SymbolInfinity = Symbol("Infinity")
2029+
SymbolList = Symbol("List")
2030+
SymbolByteArray = Symbol("ByteArray")
2031+
SymbolAssociation = Symbol("Association")
2032+
SymbolMakeBoxes = Symbol("MakeBoxes")
2033+
SymbolN = Symbol("N")
2034+
SymbolRule = Symbol("Rule")
2035+
SymbolSequence = Symbol("Sequence")
20272036

20282037

20292038
@lru_cache(maxsize=1024)

0 commit comments

Comments
 (0)