Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Unified Diff: third_party/protobuf/python/google/protobuf/message.py

Issue 6737030: third_party/protobuf: update to upstream r371 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/python/google/protobuf/message.py
diff --git a/third_party/protobuf/python/google/protobuf/message.py b/third_party/protobuf/python/google/protobuf/message.py
index f8398474f66dac34191c213461562664f35990ff..6f19f85f4fdfc5be7f2db4bbfef24371d16ebf0e 100755
--- a/third_party/protobuf/python/google/protobuf/message.py
+++ b/third_party/protobuf/python/google/protobuf/message.py
@@ -67,6 +67,11 @@ class Message(object):
DESCRIPTOR = None
+ def __deepcopy__(self, memo=None):
+ clone = type(self)()
+ clone.MergeFrom(self)
+ return clone
+
def __eq__(self, other_msg):
raise NotImplementedError
@@ -74,9 +79,15 @@ class Message(object):
# Can't just say self != other_msg, since that would infinitely recurse. :)
return not self == other_msg
+ def __hash__(self):
+ raise TypeError('unhashable object')
+
def __str__(self):
raise NotImplementedError
+ def __unicode__(self):
+ raise NotImplementedError
+
def MergeFrom(self, other_msg):
"""Merges the contents of the specified message into current message.
@@ -215,6 +226,9 @@ class Message(object):
raise NotImplementedError
def HasField(self, field_name):
+ """Checks if a certain field is set for the message. Note if the
+ field_name is not defined in the message descriptor, ValueError will be
+ raised."""
raise NotImplementedError
def ClearField(self, field_name):

Powered by Google App Engine
This is Rietveld 408576698