title: How to unpack the list created by zip()
body: <p>I have two lists that I zip() together:</p>
  
  <pre><code>&gt;&gt; x1 = ['1', '2', '3']
  &gt;&gt; y1 = ['a', 'b', 'c']
  &gt;&gt; zipped = zip(x1, y1)
  </code></pre>
  
  <p>As expected so far:</p>
  
  <pre><code>&gt;&gt; print(list(zipped)
  [('1', 'a'), ('2', 'b'), ('3', 'c')]
  </code></pre>
  
  <p>From the docs, it seems like I can just do this to get back the two lists from the zip object:</p>
  
  <pre><code>&gt;&gt; x2, y2 = zip(*zipped)
  </code></pre>
  
  <p>But instead I get the error:</p>
  
  <pre><code>Traceback (most recent call last):    
  File "/usr/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2869, in run_code
  exec(code_obj, self.user_global_ns, self.user_ns)    
  File "&lt;ipython-input-6-58fe68d00d1c&gt;", line 1, in &lt;module&gt;
  x2, y2 = zip(*zipped)
  ValueError: not enough values to unpack (expected 2, got 0)
  </code></pre>
  
  <p>Obviously I'm not understanding something simple about the zip object.</p>
  
  <p>Edit:</p>
  
  <p>As @daragua points out below, the print(list(zipped)) was actually consuming the zipped object, thus making it empty. That's true, for my simple example. I'm still having an issue with my real code.</p>
  
  <p>What I'm trying to to is write a unit test for Django view that has a zipped object in it's context. The view works fine, I'm just struggling writing the test for it.</p>
  
  <p>In my view context I have this:</p>
  
  <pre><code>for season in context['pools']:
      commissioner.append(season.pool.is_commish(self.request.user))
  context['pools'] = zip(context['pools'], commissioner)
  </code></pre>
  
  <p>This works as expected. The pools context object is two lists, which the template handles just fine:</p>
  
  <pre><code>{% for season, commissioner in pools %}
  </code></pre>
  
  <p>The test I'm struggling to write is to check if the <code>commissioner</code> value is correct for a the pool object for the logged in user. In my test:</p>
  
  <pre><code>context = self.response.context['pools']
  print(list(context ))
  </code></pre>
  
  <p>In this case, <code>context</code> is an empty list <code>[]</code>.</p>