title: Redefining Pythons builtin datatypes
body: <p>Is it possible to redefine which object the brackets [] use?</p>
  
  <p>I can subclass the <code>list</code> object, but how to I make the interpreter use my subclass in place of the buildin list object? Is it possible? </p>
  
  <p>(I'm pretty sure I'm using the wrong terms for the question- feel free to edit)</p>
  
  <pre><code>&gt;&gt;&gt; class mlist(list):
  ...     def __init__(self):
  ...         list.__init__(self)
  ...     def __getitem__(self, item):
  ...         return list.__getitem__(self, item) * 2
  ... 
  &gt;&gt;&gt; testlist = mlist()
  &gt;&gt;&gt; testlist.append(21)
  &gt;&gt;&gt; testlist[0]
  42
  &gt;&gt;&gt; list = mlist() # maybe setting the 'list' type will do it?
  &gt;&gt;&gt; testlist = []
  &gt;&gt;&gt; testlist.append(21)
  &gt;&gt;&gt; testlist[0]
  21                 # Nope
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>I don't have a practical use for this- just curious. </p>