class Complex:
def __init__(self,r,i):
self.real = r
self.imag = i
def __eq__(self,other):
if self.real == other.real and \
self.imag == other.imag: return 1
return 0
def __ne__(self,other):
return not self.__eq__(other)
def __lt__(self,other):
raise TypeError, "can't compare with <, <=, >, >="
__le__ = Complex.__lt__
__ge__ = Complex.__lt__
__gt__ = Complex.__lt__