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

def from_sympy(self, a):

    try:
        return self([self.dom.from_sympy(a)])
    except CoercionFailed:
        pass
    from sympy.polys.numberfields import to_number_field
    try:
        return self(to_number_field(a, self.ext).native_coeffs())
    except (NotAlgebraic, IsomorphismFailed):
        raise CoercionFailed(('%s    is    not    a    valid    algebraic    number    in    %s' % (a, self)))
