how to split a list into pairs in all possible ways
<p>I have a list (say 6 elements for simplicity)</p>

<pre><code>L = [0,1,2,3,4,5]
</code></pre>

<p>and I want to chunk it into pairs in <strong>ALL</strong> possible ways. I show some configurations:</p>

<pre><code>[(0,1),(2,3),(4,5)]

[(0,1),(2,4),(3,5)]

[(0,1),(2,5),(3,4)]
</code></pre>

<p>and so on. 
Here  <code>(a,b)=(b,a)</code> and the order of pairs is not important i.e.</p>

<pre><code>[(0,1),(2,3),(4,5)] = [(0,1),(4,5),(2,3)]
</code></pre>

<p>The total number of such configurations is <code>1*3*5*...*(N-1)</code> where <code>N</code> is the length of my list. Do you know how to write a generator in Python that gives my all possible configurations for an arbitrary <code>N</code>. Thanks in advance.</p>
