This installation understanding works for a list of lists for creating a tuple set:
>>> {(tuple(e)) for e in a}
set([(1, 2), (1, 3)])
Then use this to include it again in the list of lists without duplicates:
>>> [list(x) for x in {(tuple(e)) for e in a}]
[[1, 2], [1, 3]]
source
share