Skip to content

Commit 19031d7

Browse files
committed
More uses for Symbol{True,False}
1 parent cc60cc5 commit 19031d7

6 files changed

Lines changed: 200 additions & 132 deletions

File tree

mathics/builtin/combinatorial.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import sympy
99

1010
from mathics.builtin.base import Builtin
11-
from mathics.core.expression import Expression, Integer, Symbol
11+
from mathics.core.expression import Expression, Integer, Symbol, SymbolTrue, SymbolFalse
1212
from mathics.builtin.arithmetic import _MPMathFunction
1313
from itertools import combinations
1414

@@ -120,10 +120,9 @@ def generate():
120120
else:
121121
raise _NoBoolVector
122122
elif isinstance(leaf, Symbol):
123-
name = leaf.name
124-
if name == 'System`True':
123+
if leaf == SymbolTrue:
125124
yield 1
126-
elif name == 'System`False':
125+
elif leaf == SymbolFalse:
127126
yield 0
128127
else:
129128
raise _NoBoolVector

0 commit comments

Comments
 (0)