def __eq__(self, other):
    'testing if we are working in the same extension field'
    try:
        return ((self.F == other.F) and (self.irpoly == other.irpoly))
    except:
        return False
testing if we are working in the same extension field
def __eq__(self, other):
    
    try:
        return ((self.F == other.F) and (self.irpoly == other.irpoly))
    except:
        return False