|
2 | 2 | """
|
3 | 3 | Basic Arithmetic
|
4 | 4 |
|
5 |
| -The functions here are the basic arithmetic operations that you might find on a calculator. |
| 5 | +The functions here are the basic arithmetic operations that you might find \ |
| 6 | +on a calculator. |
6 | 7 |
|
7 | 8 | """
|
8 | 9 |
|
9 |
| -from mathics.builtin.arithmetic import _MPMathFunction, create_infix |
10 |
| -from mathics.builtin.base import BinaryOperator, Builtin, PrefixOperator, SympyFunction |
| 10 | +from mathics.builtin.arithmetic import create_infix |
| 11 | +from mathics.builtin.base import ( |
| 12 | + BinaryOperator, |
| 13 | + Builtin, |
| 14 | + MPMathFunction, |
| 15 | + PrefixOperator, |
| 16 | + SympyFunction, |
| 17 | +) |
11 | 18 | from mathics.core.atoms import (
|
12 | 19 | Complex,
|
13 | 20 | Integer,
|
@@ -387,7 +394,7 @@ def eval(self, items, evaluation):
|
387 | 394 | return eval_Plus(*items_tuple)
|
388 | 395 |
|
389 | 396 |
|
390 |
| -class Power(BinaryOperator, _MPMathFunction): |
| 397 | +class Power(BinaryOperator, MPMathFunction): |
391 | 398 | """
|
392 | 399 | <url>
|
393 | 400 | :Exponentiation:
|
@@ -531,7 +538,7 @@ class Power(BinaryOperator, _MPMathFunction):
|
531 | 538 | def eval_check(self, x, y, evaluation):
|
532 | 539 | "Power[x_, y_]"
|
533 | 540 |
|
534 |
| - # Power uses _MPMathFunction but does some error checking first |
| 541 | + # Power uses MPMathFunction but does some error checking first |
535 | 542 | if isinstance(x, Number) and x.is_zero:
|
536 | 543 | if isinstance(y, Number):
|
537 | 544 | y_err = y
|
@@ -788,7 +795,6 @@ def inverse(item):
|
788 | 795 | and isinstance(item.elements[1], (Integer, Rational, Real))
|
789 | 796 | and item.elements[1].to_sympy() < 0
|
790 | 797 | ): # nopep8
|
791 |
| - |
792 | 798 | negative.append(inverse(item))
|
793 | 799 | elif isinstance(item, Rational):
|
794 | 800 | numerator = item.numerator()
|
|
0 commit comments