#NEWLINE# def from_sympy( self , a ) : #NEWLINE# #INDENT# "Convert SymPy's Integer to ``dtype``. " #NEWLINE# if self . is_Integer : #NEWLINE# #INDENT# return PythonInteger ( a . p ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( a . is_Float and ( int ( a ) == a ) ) : #NEWLINE# #INDENT# return PythonInteger ( int ( a ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise CoercionFailed ( ( 'expected an integer, got %s' % a ) )