title: What is a good way to subclass python's list or UserList so I can change the underlying data but use the built-in sort?
body: <p>Lets say I want to create a list type subclass CaesarList, such that all element access are shifted by some amount (hardcoded in the class, not a parameter.  stupid yes, but this is just an example).  </p>
  
  <p>That is, if I have it hardcoded to +2,</p>
  
  <pre><code>   arr = CaesarList()
     arr.extend([1,2,3,4,5])
  </code></pre>
  
  <p>then <code>arr[2] == 5</code>, <code>arr[0]==3</code>.  So I can do that part easily by overriding <code>__getitem__</code>.  Or I want to make it a 2d array, or some other nonsense, I can override <code>__getitem__</code> and <code>__setitem__</code>.  But I want to be able to take advantage of built in sort.  How do I go about creating a UserList or list compatible subclass that will really perform <code>arr.sort()</code>?  </p>