|
10 | 10 | Atom, |
11 | 11 | Expression, |
12 | 12 | Integer, |
| 13 | + Integer0, |
13 | 14 | Integer1, |
14 | 15 | Number, |
15 | 16 | Symbol, |
@@ -61,7 +62,7 @@ def _expand(expr): |
61 | 62 | return expand(expr, numer=numer, denom=denom, deep=deep, **kwargs) |
62 | 63 |
|
63 | 64 | if kwargs["modulus"] is not None and kwargs["modulus"] <= 0: |
64 | | - return Integer(0) |
| 65 | + return Integer0 |
65 | 66 |
|
66 | 67 | # A special case for trigonometric functions |
67 | 68 | if "trig" in kwargs and kwargs["trig"]: |
@@ -496,8 +497,8 @@ class FactorTermsList(Builtin): |
496 | 497 |
|
497 | 498 | def apply_list(self, expr, vars, evaluation): |
498 | 499 | "FactorTermsList[expr_, vars_List]" |
499 | | - if expr == Integer(0): |
500 | | - return Expression("List", Integer1, Integer(0)) |
| 500 | + if expr == Integer0: |
| 501 | + return Expression("List", Integer1, Integer0) |
501 | 502 | elif isinstance(expr, Number): |
502 | 503 | return Expression("List", expr, Integer1) |
503 | 504 |
|
@@ -1053,7 +1054,7 @@ def apply(self, expr, v, evaluation): |
1053 | 1054 | # Get a coefficient of form in an expression |
1054 | 1055 | def _coefficient(name, expr, form, n, evaluation): |
1055 | 1056 | if expr == SymbolNull or form == SymbolNull or n == SymbolNull: |
1056 | | - return Integer(0) |
| 1057 | + return Integer0 |
1057 | 1058 |
|
1058 | 1059 | if not (isinstance(form, Symbol)) and not (isinstance(form, Expression)): |
1059 | 1060 | return evaluation.message(name, "ivar", form) |
@@ -1260,10 +1261,10 @@ def apply(self, expr, form, evaluation): |
1260 | 1261 | # special cases for expr and form |
1261 | 1262 | e_null = expr == SymbolNull |
1262 | 1263 | f_null = form == SymbolNull |
1263 | | - if expr == Integer(0): |
| 1264 | + if expr == Integer0: |
1264 | 1265 | return Expression("List") |
1265 | 1266 | elif e_null and f_null: |
1266 | | - return Expression("List", Integer(0)) |
| 1267 | + return Expression("List", Integer0) |
1267 | 1268 | elif e_null and not f_null: |
1268 | 1269 | return Expression("List", SymbolNull) |
1269 | 1270 | elif f_null: |
@@ -1411,7 +1412,7 @@ def apply_novar(self, expr, evaluation): |
1411 | 1412 |
|
1412 | 1413 | def apply(self, expr, form, h, evaluation): |
1413 | 1414 | "Exponent[expr_, form_, h_]" |
1414 | | - if expr == Integer(0): |
| 1415 | + if expr == Integer0: |
1415 | 1416 | return Expression("DirectedInfinity", Integer(-1)) |
1416 | 1417 |
|
1417 | 1418 | if not form.has_form("List", None): |
|
0 commit comments