aboutsummaryrefslogtreecommitdiffstats
path: root/python/google/protobuf/message.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/google/protobuf/message.py')
-rwxr-xr-xpython/google/protobuf/message.py34
1 files changed, 2 insertions, 32 deletions
diff --git a/python/google/protobuf/message.py b/python/google/protobuf/message.py
index c186452..f839847 100755
--- a/python/google/protobuf/message.py
+++ b/python/google/protobuf/message.py
@@ -1,6 +1,6 @@
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
-# https://developers.google.com/protocol-buffers/
+# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -67,28 +67,14 @@ class Message(object):
DESCRIPTOR = None
- def __deepcopy__(self, memo=None):
- clone = type(self)()
- clone.MergeFrom(self)
- return clone
-
def __eq__(self, other_msg):
- """Recursively compares two messages by value and structure."""
raise NotImplementedError
def __ne__(self, other_msg):
# 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):
- """Outputs a human-readable representation of the message."""
- raise NotImplementedError
-
- def __unicode__(self):
- """Outputs a human-readable representation of the message."""
raise NotImplementedError
def MergeFrom(self, other_msg):
@@ -177,11 +163,7 @@ class Message(object):
raise NotImplementedError
def ParseFromString(self, serialized):
- """Parse serialized protocol buffer data into this message.
-
- Like MergeFromString(), except we clear the object first and
- do not return the value that MergeFromString returns.
- """
+ """Like MergeFromString(), except we clear the object first."""
self.Clear()
self.MergeFromString(serialized)
@@ -233,9 +215,6 @@ 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):
@@ -273,12 +252,3 @@ class Message(object):
via a previous _SetListener() call.
"""
raise NotImplementedError
-
- def __getstate__(self):
- """Support the pickle protocol."""
- return dict(serialized=self.SerializePartialToString())
-
- def __setstate__(self, state):
- """Support the pickle protocol."""
- self.__init__()
- self.ParseFromString(state['serialized'])