def _AddEqualsMethod(message_descriptor, cls):
 def __eq__(self, other):
  if ((not isinstance(other, message_mod.Message)) or (other.DESCRIPTOR != self.DESCRIPTOR)):
   return False
  if (self is other):
   return True
  if (not (self.ListFields() == other.ListFields())):
   return False
  unknown_fields = list(self._unknown_fields)
  unknown_fields.sort()
  other_unknown_fields = list(other._unknown_fields)
  other_unknown_fields.sort()
  return (unknown_fields == other_unknown_fields)
 cls.__eq__ = __eq__

def _AddEqualsMethod ( message_descriptor , cls ) : def __eq__ ( self , other ) : if ( ( not isinstance ( other , message_mod . Message ) ) or ( other . DESCRIPTOR != self . DESCRIPTOR ) ) : return False if ( self is other ) : return True if ( not ( self . ListFields ( ) == other . ListFields ( ) ) ) : return False unknown_fields = list ( self . _unknown_fields ) unknown_fields . sort ( ) other_unknown_fields = list ( other . _unknown_fields ) other_unknown_fields . sort ( ) return ( unknown_fields == other_unknown_fields ) cls . __eq__ = __eq__
helper for _addmessagemethods() .