If you don't want to copy the data, and want to pass an unchangeable "list" around, one way to do so is to create a proxy object, copy of a list, which disables all changing methods, and refer the reading methods to the original list - something along:
class ReadOnlyList(list):
def __init__(self, other):
self._list = other
def __getitem__(self, index):
return self._list[index]
def __iter__(self):
return iter(self._list)
def __slice__(self, *args, **kw):
return self._list.__slice__(*args, **kw)
def __repr__(self):
return repr(self._list)
def __len__(self):
return len(self._list)
def NotImplemented(self, *args, **kw):
raise ValueError("Read Only list proxy")
append = pop = __setitem__ = __setslice__ = __delitem__ = NotImplemented
And, of course, implement whatever other methods you judge necessary, either raising the error (or ignoring the writting instruction) - or acessing the corresponding object in the internal list.