~verterok/ubuntu/lucid/protobuf/2.4.0a-backport

« back to all changes in this revision

Viewing changes to python/google/protobuf/message.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2011-05-31 14:41:47 UTC
  • mfrom: (2.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20110531144147-s41g5fozgvyo462l
Tags: 2.4.0a-2ubuntu1
* Merge with Debian; remaining changes:
  - Fix linking with -lpthread.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
 
68
68
  DESCRIPTOR = None
69
69
 
 
70
  def __deepcopy__(self, memo=None):
 
71
    clone = type(self)()
 
72
    clone.MergeFrom(self)
 
73
    return clone
 
74
 
70
75
  def __eq__(self, other_msg):
71
76
    raise NotImplementedError
72
77
 
74
79
    # Can't just say self != other_msg, since that would infinitely recurse. :)
75
80
    return not self == other_msg
76
81
 
 
82
  def __hash__(self):
 
83
    raise TypeError('unhashable object')
 
84
 
77
85
  def __str__(self):
78
86
    raise NotImplementedError
79
87
 
 
88
  def __unicode__(self):
 
89
    raise NotImplementedError
 
90
 
80
91
  def MergeFrom(self, other_msg):
81
92
    """Merges the contents of the specified message into current message.
82
93
 
215
226
    raise NotImplementedError
216
227
 
217
228
  def HasField(self, field_name):
 
229
    """Checks if a certain field is set for the message. Note if the
 
230
    field_name is not defined in the message descriptor, ValueError will be
 
231
    raised."""
218
232
    raise NotImplementedError
219
233
 
220
234
  def ClearField(self, field_name):