class_docstr: Rational field based on GMPY's ``mpq`` type.
  
  This will be the implementation of :ref:`QQ` if ``gmpy`` or ``gmpy2`` is
  installed. Elements will be of type ``gmpy.mpq``.
docstr: Convert SymPy's Integer to ``dtype``. 
docstr_tok: ["Convert","SymPy","'s","Integer","to","``","dtype","``","."]
code: def from_sympy(self, a):
      """Convert SymPy's Integer to ``dtype``."""
      if a.is_Rational:
          return GMPYRational(a.p, a.q)
      elif a.is_Float:
          from sympy.polys.domains import RR
  
          return GMPYRational(*map(int, RR.to_rational(a)))
      else:
          raise CoercionFailed(
              "expected ``Rational`` object, got %s" % a
          )
  
imports: from sympy.polys.domains.groundtypes import GMPYRational, SymPyRational, gmpy_numer, gmpy_denom, factorial
  from sympy.polys.domains.rationalfield import RationalField
  from sympy.polys.polyerrors import CoercionFailed
  from sympy.utilities import public
label_desc: Use image node_id 4 for calling the GMPYRationalField obj's underlying member method code with example usage: obj.from_sympy(a) and returns: GMPYRational, GMPYRational