Python eliminate duplicates of list with unhashable elements in one line
Question: > **Possible Duplicate:**  
>  [Python: removing duplicates from a list of
> lists](http://stackoverflow.com/questions/2213923/python-removing-
> duplicates-from-a-list-of-lists)

Say i have list

    
    
    a=[1,2,1,2,1,3]
    

If all elements in a are hashable (like in that case), this would do the job:

    
    
    list(set(a))
    

But, what if

    
    
    a=[[1,2],[1,2],[1,3]]
    

?


Answer: 
    >>> from itertools import groupby
    >>> a = [[1,2],[1,2],[1,3]]
    >>> [k for k,v in groupby(sorted(a))]
    [[1, 2], [1, 3]]
    

