def __eq__(self, other):
        """
        Note: if your Struct contains pointers, pointer equality is used
        as opposed to following the value at the pointer.
        """
        if type(self) != type(other):
            return False
        for field_name, field_type in self._fields_:
            if getattr(self, field_name) != getattr(other, field_name):
                return False
        return True
def __eq__ ( self , other ) : if type ( self ) != type ( other ) : return False for field_name , field_type in self . _fields_ : if getattr ( self , field_name ) != getattr ( other , field_name ) : return False return True
Note: if your Struct contains pointers, pointer equality is used
        as opposed to following the value at the pointer.