How to sort like values in Python
<p>I was wondering how to sort like values in a list, and then break like values into a sub-list. </p>

<p>For example: I would want a function that probably does something like </p>

<pre><code>def sort_by_like_values(list):
    #python magic

&gt;&gt;&gt;list=[2,2,3,4,4,10]
&gt;&gt;&gt;[[2,2],[3],[4,4],[10]]
OR
&gt;&gt;&gt;[2,2],[3],[4,4],[10]
</code></pre>

<p>I read up on the sorted api and it works well for sorting things within their own list, but doesn't break lists up into sub-lists. What module would help me out here?</p>
