title: How to convert list of lists to a set in python so I can compare to other sets?
body: <p>I have a list <code>users_with_invites_ids_list</code>, formed by loop where I append values to the list, in python that looks like this:</p>
  
  <pre><code>...[ObjectId('55119e14bf2e4e010d8b48f2')], [ObjectId('54624128bf2e4e5e558b5a52')], [ObjectId('53a6e7bc763f4aa0308b4569')], [ObjectId('55241823bf2e4e59508b494c')]]
  </code></pre>
  
  <p>when I try:</p>
  
  <pre><code>    users_with_invites_ids_set = set(users_with_invites_ids_list)
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>TypeError: unhashable type: 'list'
  </code></pre>
  
  <p>How do I convert this list of lists to a set?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>based on answer I've done the following:</p>
  
  <pre><code>#convert list to set
  first_tuple_list = [tuple(lst) for lst in users_with_invites_ids_list]
  users_with_invites_ids_set = set(first_tuple_list)
  </code></pre>
  
  <p>Which yields the following:</p>
  
  <pre><code> (ObjectId('542ac5a6763f4a82188b4a51'),), (ObjectId('54496fe6bf2e4efe348bd344'),), (ObjectId('54c96339bf2e4ee62c8b48e0'),)])
  </code></pre>
  
  <p>How do I get each <code>ObjectId</code> without the <code>()</code> around each one. It's keeping me from comparing this set to other set's of ids.</p>