def _AddStrMethod(message_descriptor, cls):
 def __str__(self):
  return text_format.MessageToString(self)
 cls.__str__ = __str__

def _AddStrMethod ( message_descriptor , cls ) : def __str__ ( self ) : return text_format . MessageToString ( self ) cls . __str__ = __str__
helper for _addmessagemethods() .