class_docstr: A class for representing rational function fields. 
class_docstr_tok: ["A","class","for","representing","rational","function","fields","."]
docstr: Convert SymPy's expression to ``dtype``. 
docstr_tok: ["Convert","SymPy","'s","expression","to","``","dtype","``","."]
code: def from_sympy(self, a):
      """Convert SymPy's expression to ``dtype``."""
      p, q = a.as_numer_denom()
  
      num, _ = dict_from_basic(p, gens=self.gens)
      den, _ = dict_from_basic(q, gens=self.gens)
  
      for k, v in num.items():
          num[k] = self.dom.from_sympy(v)
  
      for k, v in den.items():
          den[k] = self.dom.from_sympy(v)
  
      return self((num, den)).cancel()
  
imports: from sympy.polys.domains.field import Field
  from sympy.polys.domains.compositedomain import CompositeDomain
  from sympy.polys.polyclasses import DMF
  from sympy.polys.polyerrors import GeneratorsNeeded
  from sympy.polys.polyutils import dict_from_basic, basic_from_dict, _dict_reorder
  from sympy.utilities import public
label_desc: Use image node_id 8 for calling the FractionField obj's underlying member method code with example usage: obj.from_sympy(a) and returns: self