Skip to content

Commit 3acadd3

Browse files
committed
Add SymbolNull ...
Try speeding up workflows testing using "make -j3"
1 parent 15d9bfc commit 3acadd3

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/basic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
- name: Test Mathics
3030
run: |
3131
pip install pytest pexpect
32-
make check
32+
make -j3 check

mathics/core/expression.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ def to_python(self, *args, **kwargs):
17781778
return True
17791779
if self == SymbolFalse:
17801780
return False
1781-
if self.name == 'System`Null':
1781+
if self == SymbolNull:
17821782
return None
17831783
n_evaluation = kwargs.get('n_evaluation')
17841784
if n_evaluation is not None:
@@ -1846,8 +1846,10 @@ def user_hash(self, update) -> None:
18461846
def __getnewargs__(self):
18471847
return (self.name, self.sympy_dummy)
18481848

1849+
# Some common Symbols
18491850
SymbolTrue = Symbol("True")
18501851
SymbolFalse = Symbol("False")
1852+
SymbolNull = Symbol("Null")
18511853

18521854
class Number(Atom):
18531855
def __str__(self) -> str:

mathics/core/numbers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ def _get_float_inf(value, evaluation) -> typing.Optional[float]:
5151

5252

5353
def get_precision(value, evaluation) -> typing.Optional[int]:
54-
from mathics.core.expression import Symbol, MachineReal
5554
if value.get_name() == 'System`MachinePrecision':
5655
return None
5756
else:
57+
from mathics.core.expression import Symbol, MachineReal
5858
dmin = _get_float_inf(Symbol('$MinPrecision'), evaluation)
5959
dmax = _get_float_inf(Symbol('$MaxPrecision'), evaluation)
6060
d = value.round_to_float(evaluation)

0 commit comments

Comments
 (0)