title: Comprehension for flattening a sequence of sequences?
body: <p>If I have sequence of sequences (maybe a list of tuples) I can use itertools.chain() to flatten it. But sometimes I feel like I would rather write it as a comprehension. I just can't figure out how to do it. Here's a very construed case:</p>
  
  <p>Let's say I want to swap the elements of every pair in a sequence. I use a string as a sequence here:</p>
  
  <pre><code>&gt;&gt;&gt; from itertools import chain
  &gt;&gt;&gt; seq = '012345'
  &gt;&gt;&gt; swapped_pairs = zip(seq[1::2], seq[::2])
  &gt;&gt;&gt; swapped_pairs
  [('1', '0'), ('3', '2'), ('5', '4')]
  &gt;&gt;&gt; "".join(chain(*swapped_pairs))
  '103254'
  </code></pre>
  
  <p>I use zip on the even and odd slices of the sequence to swap the pairs. But I end up with a list of tuples that now need to be flattened. So I use chain(). Is there a way I could express it with a comprehension instead?</p>
  
  <p>If you want to post your own solution to the basic problem of swapping elements of the pairs, go ahead, I'll up-vote anything that teaches me something new. But I will only mark as accepted an answer that is targeted on my question, even if the answer is "No, you can't.".</p>