'Convert SymPy\'s expression to ``dtype``.'

def from_sympy(self, a):

    (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()
