"""$URL: svn+ssh://svn.mems-exchange.org/repos/trunk/dulcinea/lib/immutable_list.py $
$Id: immutable_list.py 20912 2003-03-04 16:07:12Z dbinger $

Contains an immutable list class, that can be concatenated with other
lists but can't be mutated in-place.  This should be used to declare
list constants that will truly remain constant and won't be
inadvertantly modified by other code.

"""

class ImmutableList (list):

    """An immutable list class, that can be concatenated with other
    lists but can't be mutated in-place.
    """

    __slots__ = []

    def __setitem__(self, i, item):
        raise TypeError, "ImmutableList doesn't support item assignment"
    def __delitem__ (self, i):
        raise TypeError, "ImmutableList doesn't support item deletion"
    def __setslice__(self, i, j, other):
        raise TypeError, "ImmutableList doesn't support slice assignment"
    def __delslice__(self, i, j):
        raise TypeError, "ImmutableList doesn't support slice deletion"
    def __iadd__(self, other):
        raise TypeError, "ImmutableList doesn't support in-place addition"
    def __imul__(self, other):
        raise TypeError, \
              "ImmutableList doesn't support in-place multiplication"
    def append(self, item):
        raise TypeError, "ImmutableList doesn't support append()"
    def insert(self, i, item):
        raise TypeError, "ImmutableList doesn't support insert()"
    def pop(self, i=-1):
        raise TypeError, "ImmutableList doesn't support pop()"
    def remove(self, item):
        raise TypeError, "ImmutableList doesn't support remove()"
    def reverse(self):
        raise TypeError, "ImmutableList doesn't support reverse()"
    def sort(self, *args):
        raise TypeError, "ImmutableList doesn't support sort()"
    def extend(self, other):
        raise TypeError, "ImmutableList doesn't support extend()"

# class ImmutableList
