class_docstr: Exact rational type, currently only intended for internal use.
class_docstr_tok: ["Exact","rational","type",",","currently","only","intended","for","internal","use","."]
code: def _cmp(s, t, op):
      ttype = type(t)
      if ttype in int_types:
          a, b = s._mpq_
          return op(a, t * b)
      if ttype is mpq:
          a, b = s._mpq_
          c, d = t._mpq_
          return op(a * d, b * c)
      return NotImplementedError
  
imports: import operator
  import sys
  from .libmp import int_types, mpf_hash, bitcount, from_man_exp, HASH_MODULUS
label_desc: Use image node_id 9 for calling the mpq obj's underlying member method code with example usage: obj._cmp(s, t, op) and returns: NotImplementedError, op, op