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

def from_sympy(self, a):

    if a.is_Integer:
        return PythonInteger(a.p)
    elif (a.is_Float and (int(a) == a)):
        return PythonInteger(int(a))
    else:
        raise CoercionFailed(('expected    an    integer,    got    %s' % a))
