title: Sorting a list of tuples based on the first items
body: <p>How to sort a list of tuples based on the first value i.e, in a dictionary we can use <code>sorted(a.keys())</code>.</p>
  
  <p>How to do it for a list of tuples?</p>
  
  <p>If these are the tuple values </p>
  
  <pre><code>t = [('2010-09-11', 'somedata', somedata),
       ('2010-06-11', 'somedata', somedata),
       ('2010-09-12', 'somedata', somedata)]
  </code></pre>
  
  <p>tuples should be sorted based on dates in the first field.</p>