~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_static_tuple_py.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-23 18:40:24 UTC
  • mfrom: (4759.2.20 statictuple-pickling)
  • Revision ID: pqm@pqm.ubuntu.com-20091023184024-igfxawbh4tkag0ui
(Matt Nordhoff) Add Pickle support to the StaticTuple class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    def __repr__(self):
49
49
        return '%s%s' % (self.__class__.__name__, tuple.__repr__(self))
50
50
 
 
51
    def __reduce__(self):
 
52
        return (StaticTuple, tuple(self))
 
53
 
51
54
    def __add__(self, other):
52
55
        """Concatenate self with other"""
53
56
        return StaticTuple.from_sequence(tuple.__add__(self,other))