#!/usr/local/bin/python2 from collections import Mapping, Sequence class ListView(Sequence): __slots__ = ('_sequence') def __init__(self, sequence): self._sequence = sequence def __getitem__(self, index): return self._sequence[index] def __len__(self): return len(self._sequence) def __repr__(self): return repr(self._sequence) class SortableView(ListView): __slots__ = () def sort(*args, **kwargs): args[0]._sequence.sort(*args[1:], **kwargs) v = SortableView([14,7,2,8,]) v.sort() print str(v)