class_docstr: Test equality and ordering comparisons for built-in types and
  user-defined classes that implement relevant combinations of rich
  comparison methods.
class_docstr_tok: ["Test","equality","and","ordering","comparisons","for","built-in","types","and","user-defined","classes","that","implement","relevant","combinations","of","rich","comparison","methods","."]
docstr: Compare number types.
docstr_tok: ["Compare","number","types","."]
code: def test_numbers(self):
      """Compare number types."""
  
      # Same types.
      i1 = 1001
      i2 = 1002
      self.assert_total_order(i1, i1, 0)
      self.assert_total_order(i1, i2, -1)
  
      f1 = 1001.0
      f2 = 1001.1
      self.assert_total_order(f1, f1, 0)
      self.assert_total_order(f1, f2, -1)
  
      q1 = Fraction(2002, 2)
      q2 = Fraction(2003, 2)
      self.assert_total_order(q1, q1, 0)
      self.assert_total_order(q1, q2, -1)
  
      d1 = Decimal("1001.0")
      d2 = Decimal("1001.1")
      self.assert_total_order(d1, d1, 0)
      self.assert_total_order(d1, d2, -1)
  
      c1 = 1001 + 0j
      c2 = 1001 + 1j
      self.assert_equality_only(c1, c1, True)
      self.assert_equality_only(c1, c2, False)
  
      # Mixing types.
      for n1, n2 in (
          (i1, f1),
          (i1, q1),
          (i1, d1),
          (f1, q1),
          (f1, d1),
          (q1, d1),
      ):
          self.assert_total_order(n1, n2, 0)
      for n1 in (i1, f1, q1, d1):
          self.assert_equality_only(n1, c1, True)
  
imports: import unittest
  from test.support import ALWAYS_EQ
  from fractions import Fraction
  from decimal import Decimal
label_desc: Use image node_id 14 for calling the ComparisonFullTest obj's underlying member method code with example usage: obj.test_numbers() without return types