#NEWLINE# def __eq__( a , b ) : #NEWLINE# #INDENT# 'a == b' #NEWLINE# if isinstance ( b , Rational ) : #NEWLINE# #INDENT# return ( ( a . _numerator == b . numerator ) and ( a . _denominator == b . denominator ) ) #NEWLINE# #UNINDENT# if ( isinstance ( b , numbers . Complex ) and ( b . imag == 0 ) ) : #NEWLINE# #INDENT# b = b . real #NEWLINE# #UNINDENT# if isinstance ( b , float ) : #NEWLINE# #INDENT# return ( b == a . from_float ( b ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( float ( a ) == b )