Repository: sympy/sympy

Issue:
None > -oo?
```
Right now, None appears to be located amongst the finite reals:

>>> -oo<None<oo
True

>>> None>-2
False
>>> None>-oo
True
>>> None < oo
True
>>> None < 2

Perhaps it should be less than all Numbers?
```

Original issue for #6133: http://code.google.com/p/sympy/issues/detail?id=3034
Original author: https://code.google.com/u/117933771799683895267/


Discussion:

Patch:
diff --git a/.mailmap b/.mailmap
index 9338d58a44..37f68ffdd1 100644
--- a/.mailmap
+++ b/.mailmap
@@ -394,10 +394,6 @@ Gagandeep Singh <singh.23@iitj.ac.in> czgdp1807 <gdp.1807@gmail.com>
 Gagandeep Singh <singh.23@iitj.ac.in> czgdp1807 <36567889+czgdp1807@users.noreply.github.com>
 Gagandeep Singh <singh.23@iitj.ac.in> czgdp1807 <czgdp1807@gmail.com>
 Gagandeep Singh <singh.23@iitj.ac.in> MathLover <36567889+czgdp1807@users.noreply.github.com>
-Gagandeep Singh <singh.23@iitj.ac.in> czgdp1807 <singh.23@iitj.ac.in>
-Gagandeep Singh <singh.23@iitj.ac.in> Gagandeep Singh <36567889+czgdp1807@users.noreply.github.com>
-Gagandeep Singh <singh.23@iitj.ac.in> Gagandeep Singh <czgdp1807@gmail.com>
-Gagandeep Singh <singh.23@iitj.ac.in> Gagandeep Singh <singh.23@iitj.ac.in>
 S.Y. Lee <sylee957@gmail.com> sylee957 <sylee957@gmail.com>
 Yatna Verma <yatnavermaa@gmail.com> yatna <yatnavermaa@gmail.com>
 Jared Lumpe <mjlumpe@gmail.com> Michael Jared Lumpe <mjlumpe@gmail.com>
@@ -407,9 +403,3 @@ amsuhane <ayushsuhane99@iitkgp.ac.in> amsuhane <“ayushsuhane99@iitkgp.ac.in”
 Ritu Raj Singh <RituRajSingh878@gmail.com> Ritu Raj Singh <37741324+RituRajSingh878@users.noreply.github.com>
 Ritu Raj Singh <RituRajSingh878@gmail.com> RituRajSingh878 <RituRajSingh878@gmail.com>
 rationa-kunal <kunalgk1999@gmail.com> kunal <kunalgk1999@protonmail.com>
-shiksha11 <shiksharawat01@gmail.com> shiksha11 <33157995+shiksha11@users.noreply.github.com>
-Jogi Miglani <jmig5776@gmail.com> jmig5776 <jmig5776@gmail.com>
-Supreet Agrawal <supreet11agrawal@gmail.com> stm <supreet11agrawal@gmail.com>
-Bavish Kulur <bavishkulur@gmail.com> bavish2201 <bavishkulur@gmail.com>
-Divyanshu Thakur <divyanshu@iiitmanipur.ac.in> Divyanshu <divyanshu@iiitmanipur.ac.in>
-Shubham Kumar Jha <skjha832@gmail.com> ShubhamKJha <skjha832@gmail.com>
diff --git a/AUTHORS b/AUTHORS
index 525bc9cb75..3f288c13e1 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -4,7 +4,7 @@ those who explicitly didn't want to be mentioned. People with a * next
 to their names are not found in the metadata of the git history. This
 file is generated automatically by running `./bin/authors_update.py`.
 
-There are a total of 798 authors.
+There are a total of 782 authors.
 
 Ondřej Čertík <ondrej@certik.cz>
 Fabian Pedregosa <fabian@fseoane.net>
@@ -788,19 +788,3 @@ Ritu Raj Singh <RituRajSingh878@gmail.com>
 Rajiv Ranjan Singh <42106787+iamrajiv@users.noreply.github.com>
 Vera Lozhkina <veralozhkina@gmail.com>
 adhoc-king <46354827+adhoc-king@users.noreply.github.com>
-Mikel Rouco <mikel.mrm@gmail.com>
-Oscar Gustafsson <oscar.gustafsson@gmail.com>
-damianos <damianos@semmle.com>
-Supreet Agrawal <supreet11agrawal@gmail.com>
-shiksha11 <shiksharawat01@gmail.com>
-Martin Ueding <dev@martin-ueding.de>
-sharma-kunal <kunalsharma6914@gmail.com>
-Divyanshu Thakur <divyanshu@iiitmanipur.ac.in>
-Susumu Ishizuka <susumu.ishizuka@kii.com>
-Samnan Rahee <namanush.rsr.16@gmail.com>
-Fredrik Andersson <fredrik.andersson@fcc.chalmers.se>
-Bhavya Srivastava <bhavya17037@iiitd.ac.in>
-Alpesh Jamgade <alpeshjamgade21@gmail.com>
-Shubham Abhang <shubhamabhang77@gmail.com>
-Vishesh Mangla <manglavishesh64@gmail.com>
-Nicko van Someren <nicko@nicko.org>
diff --git a/bin/authors_update.py b/bin/authors_update.py
index 0362356f15..d23b4ce96d 100755
--- a/bin/authors_update.py
+++ b/bin/authors_update.py
@@ -94,8 +94,6 @@ def move(l, i1, i2, who):
         ), 'Sergey B Kirpichev was not found at line 226.'
     assert 'azure-pipelines[bot]' == \
         author_name(git_people.pop(751)), 'azure-pipelines[bot] was not found at line 751'
-    assert 'whitesource-bolt-for-github[bot]' == \
-        author_name(git_people.pop(792)), 'whitesource-bolt-for-github[bot] not found at line 792'
 except AssertionError as msg:
     print(red(msg))
     sys.exit(1)
@@ -154,5 +152,3 @@ def move(l, i1, i2, who):
     print()
     for i in sorted(new_authors, key=lambda x: x.lower()):
         print('\t%s' % i)
-else:
-    print(yellow("The AUTHORS file was updated."))
diff --git a/sympy/geometry/ellipse.py b/sympy/geometry/ellipse.py
index 88c0cccb47..027d660061 100644
--- a/sympy/geometry/ellipse.py
+++ b/sympy/geometry/ellipse.py
@@ -15,7 +15,7 @@
 from sympy.core.compatibility import ordered
 from sympy.core.symbol import Dummy, _uniquely_named_symbol, _symbol
 from sympy.simplify import simplify, trigsimp
-from sympy.functions.elementary.miscellaneous import sqrt, Max
+from sympy.functions.elementary.miscellaneous import sqrt
 from sympy.functions.elementary.trigonometric import cos, sin
 from sympy.functions.special.elliptic_integrals import elliptic_e
 from sympy.geometry.exceptions import GeometryError
@@ -1005,22 +1005,6 @@ def semilatus_rectum(self):
         """
         return self.major * (1 - self.eccentricity ** 2)
 
-    def auxiliary_circle(self):
-        """Returns a Circle whose diameter is the major axis of the ellipse.
-
-        Examples
-        ========
-
-        >>> from sympy import Circle, Ellipse, Point, symbols
-        >>> c = Point(1, 2)
-        >>> Ellipse(c, 8, 7).auxiliary_circle()
-        Circle(Point2D(1, 2), 8)
-        >>> a, b = symbols('a b')
-        >>> Ellipse(c, a, b).auxiliary_circle()
-        Circle(Point2D(1, 2), Max(a, b))
-        """
-        return Circle(self.center, Max(self.hradius, self.vradius))
-
     def plot_interval(self, parameter='t'):
         """The plot interval for the default geometric plot of the Ellipse.
 
diff --git a/sympy/matrices/expressions/matadd.py b/sympy/matrices/expressions/matadd.py
index 1c28021249..22315096ce 100644
--- a/sympy/matrices/expressions/matadd.py
+++ b/sympy/matrices/expressions/matadd.py
@@ -8,9 +8,8 @@
 from sympy.matrices.matrices import MatrixBase
 from sympy.matrices.expressions.transpose import transpose
 from sympy.strategies import (rm_id, unpack, flatten, sort, condition,
-    exhaust, do_one, glom)
-from sympy.matrices.expressions.matexpr import (MatrixExpr, ShapeError,
-    ZeroMatrix, GenericZeroMatrix)
+        exhaust, do_one, glom)
+from sympy.matrices.expressions.matexpr import MatrixExpr, ShapeError, ZeroMatrix
 from sympy.utilities import default_sort_key, sift
 from sympy.core.operations import AssocOp
 
@@ -33,12 +32,6 @@ class MatAdd(MatrixExpr, Add):
     is_MatAdd = True
 
     def __new__(cls, *args, **kwargs):
-        if not args:
-            return GenericZeroMatrix()
-
-        # This must be removed aggressively in the constructor to avoid
-        # TypeErrors from GenericZeroMatrix().shape
-        args = filter(lambda i: GenericZeroMatrix() != i, args)
         args = list(map(sympify, args))
         check = kwargs.get('check', False)
 
diff --git a/sympy/matrices/expressions/matexpr.py b/sympy/matrices/expressions/matexpr.py
index 4eed7af61e..124e9994e2 100644
--- a/sympy/matrices/expressions/matexpr.py
+++ b/sympy/matrices/expressions/matexpr.py
@@ -549,15 +549,6 @@ def applyfunc(self, func):
         from .applyfunc import ElementwiseApplyFunction
         return ElementwiseApplyFunction(func, self)
 
-    def _eval_Eq(self, other):
-        if not isinstance(other, MatrixExpr):
-            return False
-        if self.shape != other.shape:
-            return False
-        if (self - other).is_ZeroMatrix:
-            return True
-        return Eq(self, other, evaluate=False)
-
 
 def _matrix_derivative(expr, x):
     from sympy import Derivative
@@ -747,10 +738,6 @@ def cols(self):
     def shape(self):
         return (self.args[0], self.args[0])
 
-    @property
-    def is_square(self):
-        return True
-
     def _eval_transpose(self):
         return self
 
@@ -774,39 +761,6 @@ def _entry(self, i, j, **kwargs):
     def _eval_determinant(self):
         return S.One
 
-class GenericIdentity(Identity):
-    """
-    An identity matrix without a specified shape
-
-    This exists primarily so MatMul() with no arguments can return something
-    meaningful.
-    """
-    def __new__(cls):
-        # super(Identity, cls) instead of super(GenericIdentity, cls) because
-        # Identity.__new__ doesn't have the same signature
-        return super(Identity, cls).__new__(cls)
-
-    @property
-    def rows(self):
-        raise TypeError("GenericIdentity does not have a specified shape")
-
-    @property
-    def cols(self):
-        raise TypeError("GenericIdentity does not have a specified shape")
-
-    @property
-    def shape(self):
-        raise TypeError("GenericIdentity does not have a specified shape")
-
-    # Avoid Matrix.__eq__ which might call .shape
-    def __eq__(self, other):
-        return isinstance(other, GenericIdentity)
-
-    def __ne__(self, other):
-        return not (self == other)
-
-    def __hash__(self):
-        return super(GenericIdentity, self).__hash__()
 
 class ZeroMatrix(MatrixExpr):
     """The Matrix Zero 0 - additive identity
@@ -862,40 +816,6 @@ def __nonzero__(self):
 
     __bool__ = __nonzero__
 
-class GenericZeroMatrix(ZeroMatrix):
-    """
-    A zero matrix without a specified shape
-
-    This exists primarily so MatAdd() with no arguments can return something
-    meaningful.
-    """
-    def __new__(cls):
-        # super(ZeroMatrix, cls) instead of super(GenericZeroMatrix, cls)
-        # because ZeroMatrix.__new__ doesn't have the same signature
-        return super(ZeroMatrix, cls).__new__(cls)
-
-    @property
-    def rows(self):
-        raise TypeError("GenericZeroMatrix does not have a specified shape")
-
-    @property
-    def cols(self):
-        raise TypeError("GenericZeroMatrix does not have a specified shape")
-
-    @property
-    def shape(self):
-        raise TypeError("GenericZeroMatrix does not have a specified shape")
-
-    # Avoid Matrix.__eq__ which might call .shape
-    def __eq__(self, other):
-        return isinstance(other, GenericZeroMatrix)
-
-    def __ne__(self, other):
-        return not (self == other)
-
-
-    def __hash__(self):
-        return super(GenericZeroMatrix, self).__hash__()
 
 def matrix_symbols(expr):
     return [sym for sym in expr.free_symbols if sym.is_Matrix]
diff --git a/sympy/matrices/expressions/matmul.py b/sympy/matrices/expressions/matmul.py
index cff91f73f7..fb861a70ba 100644
--- a/sympy/matrices/expressions/matmul.py
+++ b/sympy/matrices/expressions/matmul.py
@@ -8,7 +8,7 @@
 from sympy.strategies import (rm_id, unpack, typed, flatten, exhaust,
         do_one, new)
 from sympy.matrices.expressions.matexpr import (MatrixExpr, ShapeError,
-        Identity, ZeroMatrix, GenericIdentity)
+        Identity, ZeroMatrix)
 from sympy.matrices.expressions.matpow import MatPow
 from sympy.matrices.matrices import MatrixBase
 
@@ -31,22 +31,12 @@ class MatMul(MatrixExpr, Mul):
 
     def __new__(cls, *args, **kwargs):
         check = kwargs.get('check', True)
-
-        if not args:
-            return GenericIdentity()
-
-        # This must be removed aggressively in the constructor to avoid
-        # TypeErrors from GenericIdentity().shape
-        args = filter(lambda i: GenericIdentity() != i, args)
         args = list(map(sympify, args))
         obj = Basic.__new__(cls, *args)
         factor, matrices = obj.as_coeff_matrices()
         if check:
             validate(*matrices)
         if not matrices:
-            # Should it be
-            #
-            # return Basic.__neq__(cls, factor, GenericIdentity()) ?
             return factor
         return obj
 
diff --git a/sympy/printing/mathml.py b/sympy/printing/mathml.py
index 6ddab5edf1..9d2455dcd7 100644
--- a/sympy/printing/mathml.py
+++ b/sympy/printing/mathml.py
@@ -929,7 +929,7 @@ def _print_Basic(self, e):
     def _print_AssocOp(self, e):
         mrow = self.dom.createElement('mrow')
         mi = self.dom.createElement('mi')
-        mi.appendChild(self.dom.createTextNode(self.mathml_tag(e)))
+        mi.append(self.dom.createTextNode(self.mathml_tag(e)))
         mrow.appendChild(mi)
         for arg in e.args:
             mrow.appendChild(self._print(arg))
@@ -950,50 +950,6 @@ def _print_int(self, p):
         return dom_element
 
 
-    def _print_Integers(self, e):
-        x = self.dom.createElement('mi')
-        x.setAttribute('mathvariant', 'normal')
-        x.appendChild(self.dom.createTextNode('&#x2124;'))
-        return x
-
-
-    def _print_Complexes(self, e):
-        x = self.dom.createElement('mi')
-        x.setAttribute('mathvariant', 'normal')
-        x.appendChild(self.dom.createTextNode('&#x2102;'))
-        return x
-
-
-    def _print_Reals(self, e):
-        x = self.dom.createElement('mi')
-        x.setAttribute('mathvariant', 'normal')
-        x.appendChild(self.dom.createTextNode('&#x211D;'))
-        return x
-
-
-    def _print_Naturals(self, e):
-        x = self.dom.createElement('mi')
-        x.setAttribute('mathvariant', 'normal')
-        x.appendChild(self.dom.createTextNode('&#x2115;'))
-        return x
-
-
-    def _print_Naturals0(self, e):
-        sub = self.dom.createElement('msub')
-        x = self.dom.createElement('mi')
-        x.setAttribute('mathvariant', 'normal')
-        x.appendChild(self.dom.createTextNode('&#x2115;'))
-        sub.appendChild(x)
-        sub.appendChild(self._print(S.Zero))
-        return sub
-
-
-    def _print_EmptySet(self, e):
-        x = self.dom.createElement('mo')
-        x.appendChild(self.dom.createTextNode('&#x2205;'))
-        return x
-
-
 def mathml(expr, printer='content', **settings):
     """Returns the MathML representation of expr. If printer is presentation then
      prints Presentation MathML else prints content MathML.


Test patch:
diff --git a/sympy/core/tests/test_args.py b/sympy/core/tests/test_args.py
index 5895f1ca84..dc98b2191c 100644
--- a/sympy/core/tests/test_args.py
+++ b/sympy/core/tests/test_args.py
@@ -2666,9 +2666,6 @@ def test_sympy__matrices__expressions__matexpr__Identity():
     from sympy.matrices.expressions.matexpr import Identity
     assert _test_args(Identity(3))
 
-def test_sympy__matrices__expressions__matexpr__GenericIdentity():
-    from sympy.matrices.expressions.matexpr import GenericIdentity
-    assert _test_args(GenericIdentity())
 
 @SKIP("abstract class")
 def test_sympy__matrices__expressions__matexpr__MatrixExpr():
@@ -2689,9 +2686,6 @@ def test_sympy__matrices__expressions__matexpr__ZeroMatrix():
     from sympy.matrices.expressions.matexpr import ZeroMatrix
     assert _test_args(ZeroMatrix(3, 5))
 
-def test_sympy__matrices__expressions__matexpr__GenericZeroMatrix():
-    from sympy.matrices.expressions.matexpr import GenericZeroMatrix
-    assert _test_args(GenericZeroMatrix())
 
 def test_sympy__matrices__expressions__matmul__MatMul():
     from sympy.matrices.expressions.matmul import MatMul
diff --git a/sympy/core/tests/test_numbers.py b/sympy/core/tests/test_numbers.py
index efc36b74a3..624a8bf293 100644
--- a/sympy/core/tests/test_numbers.py
+++ b/sympy/core/tests/test_numbers.py
@@ -1917,3 +1917,10 @@ def test_NegativeInfinity():
     assert((-oo).ceiling() == -oo)
     assert((-oo)**11 == -oo)
     assert((-oo)**12 == oo)
+
+def test_issue_6133():
+    raises(TypeError, lambda: (-oo < None))
+    raises(TypeError, lambda: (S(-2) < None))
+    raises(TypeError, lambda: (oo < None))
+    raises(TypeError, lambda: (oo > None))
+    raises(TypeError, lambda: (S(2) < None))
diff --git a/sympy/core/tests/test_sympify.py b/sympy/core/tests/test_sympify.py
index 1cb13e2f25..c82e272b3b 100644
--- a/sympy/core/tests/test_sympify.py
+++ b/sympy/core/tests/test_sympify.py
@@ -660,9 +660,3 @@ class CustomSymbol(Symbol):
     a = sympify(numpy.str_('x + x'), evaluate=False)
     assert isinstance(a, Add)
     assert a == Add(x, x, evaluate=False)
-
-
-def test_issue_5939():
-     a = Symbol('a')
-     b = Symbol('b')
-     assert sympify('''a+\nb''') == a + b
diff --git a/sympy/geometry/tests/test_ellipse.py b/sympy/geometry/tests/test_ellipse.py
index 12e3af49d0..8a97c52dd1 100644
--- a/sympy/geometry/tests/test_ellipse.py
+++ b/sympy/geometry/tests/test_ellipse.py
@@ -5,7 +5,6 @@
 from sympy.utilities.pytest import raises
 from sympy import integrate
 from sympy.functions.special.elliptic_integrals import elliptic_e
-from sympy.functions.elementary.miscellaneous import Max
 
 
 def test_ellipse_equation_using_slope():
@@ -436,7 +435,6 @@ def test_parameter_value():
     assert e.parameter_value((3, 0), t) == {t: 0}
     raises(ValueError, lambda: e.parameter_value((4, 0), t))
 
-
 def test_second_moment_of_area():
     x, y = symbols('x, y')
     e = Ellipse(Point(0, 0), 5, 4)
@@ -448,7 +446,6 @@ def test_second_moment_of_area():
     assert I_xx == e.second_moment_of_area()[0]
     assert I_xy == e.second_moment_of_area()[2]
 
-
 def test_circumference():
     M = Symbol('M')
     m = Symbol('m')
@@ -464,16 +461,5 @@ def test_circumference():
 
     # test numerically
     assert abs(Ellipse(None, hradius=5, vradius=3).circumference.evalf(16) - 25.52699886339813) < 1e-10
-
-
 def test_issue_15259():
     assert Circle((1, 2), 0) == Point(1, 2)
-
-
-def test_auxiliary_circle():
-    x, y, a, b = symbols('x y a b')
-    e = Ellipse((x, y), a, b)
-    # the general result
-    assert e.auxiliary_circle() == Circle((x, y), Max(a, b))
-    # a special case where Ellipse is a Circle
-    assert Circle((3, 4), 8).auxiliary_circle() == Circle((3, 4), 8)
diff --git a/sympy/matrices/expressions/tests/test_matexpr.py b/sympy/matrices/expressions/tests/test_matexpr.py
index 60da49fd65..ace95c2802 100644
--- a/sympy/matrices/expressions/tests/test_matexpr.py
+++ b/sympy/matrices/expressions/tests/test_matexpr.py
@@ -8,10 +8,8 @@
 from sympy.matrices import (Identity, ImmutableMatrix, Inverse, MatAdd, MatMul,
         MatPow, Matrix, MatrixExpr, MatrixSymbol, ShapeError, ZeroMatrix,
         SparseMatrix, Transpose, Adjoint)
-from sympy.matrices.expressions.matexpr import (MatrixElement,
-    GenericZeroMatrix, GenericIdentity)
+from sympy.matrices.expressions.matexpr import MatrixElement
 from sympy.utilities.pytest import raises
-from sympy import Eq
 
 
 n, m, l, k, p = symbols('n m l k p', integer=True)
@@ -362,54 +360,3 @@ def test_issue_2749():
 def test_issue_2750():
     x = MatrixSymbol('x', 1, 1)
     assert (x.T*x).as_explicit()**-1 == Matrix([[x[0, 0]**(-2)]])
-
-
-def test_issue_7842():
-    A = MatrixSymbol('A', 3, 1)
-    B = MatrixSymbol('B', 2, 1)
-    assert Eq(A, B) == False
-    assert Eq(A[1,0], B[1, 0]).func is Eq
-    A = ZeroMatrix(2, 3)
-    B = ZeroMatrix(2, 3)
-    assert Eq(A, B) == True
-
-
-def test_generic_zero_matrix():
-    z = GenericZeroMatrix()
-    A = MatrixSymbol("A", n, n)
-
-    assert z == z
-    assert z != A
-    assert A != z
-
-    assert z.is_ZeroMatrix
-
-    raises(TypeError, lambda: z.shape)
-    raises(TypeError, lambda: z.rows)
-    raises(TypeError, lambda: z.cols)
-
-    assert MatAdd() == z
-    assert MatAdd(z, A) == MatAdd(A)
-    # Make sure it is hashable
-    hash(z)
-
-
-def test_generic_identity():
-    I = GenericIdentity()
-    A = MatrixSymbol("A", n, n)
-
-    assert I == I
-    assert I != A
-    assert A != I
-
-    assert I.is_Identity
-    assert I**-1 == I
-
-    raises(TypeError, lambda: I.shape)
-    raises(TypeError, lambda: I.rows)
-    raises(TypeError, lambda: I.cols)
-
-    assert MatMul() == I
-    assert MatMul(I, A) == MatMul(A)
-    # Make sure it is hashable
-    hash(I)
diff --git a/sympy/printing/tests/test_mathml.py b/sympy/printing/tests/test_mathml.py
index 5c876d140b..21df48d6eb 100644
--- a/sympy/printing/tests/test_mathml.py
+++ b/sympy/printing/tests/test_mathml.py
@@ -925,25 +925,6 @@ def test_toprettyxml_hooking():
     assert prettyxml_old2 == doc2.toprettyxml()
 
 
-def test_print_domains():
-    from sympy import Complexes, Integers, Naturals, Naturals0, Reals
-
-    assert mpp.doprint(Complexes) == '<mi mathvariant="normal">&#x2102;</mi>'
-    assert mpp.doprint(Integers) == '<mi mathvariant="normal">&#x2124;</mi>'
-    assert mpp.doprint(Naturals) == '<mi mathvariant="normal">&#x2115;</mi>'
-    assert mpp.doprint(Naturals0) == '<msub><mi mathvariant="normal">&#x2115;</mi><mn>0</mn></msub>'
-    assert mpp.doprint(Reals) == '<mi mathvariant="normal">&#x211D;</mi>'
-
-
-def test_print_AssocOp():
-    from sympy.core.operations import AssocOp
-    class TestAssocOp(AssocOp):
-        identity = 0
-
-    expr = TestAssocOp(1, 2)
-    mpp.doprint(expr) == '<mrow><mi>testassocop</mi><mn>2</mn><mn>1</mn></mrow>'
-
-
 def test_print_basic():
     expr = Basic(1, 2)
     assert mpp.doprint(expr) == '<mrow><mi>basic</mi><mfenced><mn>1</mn><mn>2</mn></mfenced></mrow>'