/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/_static_tuple_py.py

  • Committer: Andrew Bennetts
  • Date: 2009-11-19 06:28:13 UTC
  • mfrom: (4811 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4812.
  • Revision ID: andrew.bennetts@canonical.com-20091119062813-t6sd6gwbot8nfyze
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
class StaticTuple(tuple):
25
25
    """A static type, similar to a tuple of strings."""
26
26
 
 
27
    __slots__ = ()
 
28
 
27
29
    def __new__(cls, *args):
28
30
        # Make the empty StaticTuple a singleton
29
31
        if not args and _empty_tuple is not None:
48
50
    def __repr__(self):
49
51
        return '%s%s' % (self.__class__.__name__, tuple.__repr__(self))
50
52
 
 
53
    def __reduce__(self):
 
54
        return (StaticTuple, tuple(self))
 
55
 
51
56
    def __add__(self, other):
52
57
        """Concatenate self with other"""
53
58
        return StaticTuple.from_sequence(tuple.__add__(self,other))