Python way of doing difference of lists containing lists
<p>Consider two lists A and B. I know that <code>list(set(A) - set(B))</code> will give the difference between A and B. What about the situation whereby elements in both A and B are lists. i.e. A and B are list of list? For e.g.</p>

<pre><code>A = [[1,2], [3,4], [5,6]]
B = [[3,4], [7,8]]
</code></pre>

<p>I wish to return the difference <code>A - B</code>  as a list of list i.e. <code>[[1,2],[5,6]]</code></p>

<pre><code>list(set(A) - set(B))
TypeError: unhashable type: 'list'
</code></pre>

<pre><code>A = [[1, 2], [3, 4], [5, 6]]
B = [[3, 4], [7, 8]]

print[x for x in A if x not in B]
</code></pre>

python