Python "triplet" dictionary? : <p>If we have <code>(a1, b1)</code> and <code>(a2, b2)</code> it's easy to use a dictionary to store the correspondences:</p>

<pre><code>dict[a1] = b1
dict[a2] = b2
</code></pre>

<p>And we can get <code>(a1, b1)</code> and <code>(a2, b2)</code> back no problem.</p>

<p>But, if we have <code>(a1, b1, c1)</code> and <code>(a2, b2, c2)</code>, is it possible to get something like:</p>

<pre><code>dict[a1] = (b1, c1)
dict[b1] = (a1, c1)
</code></pre>

<p>Where we can use either <code>a1</code> or <code>b1</code> to get the triplet <code>(a1, b1, c2)</code> back? Does that make sense? I'm not quite sure which datatype to use for this problem. The above would work but there would be duplicate data. </p>

<p>Basically, if I have a triplet, which data type could I use such that I can use either the first or second value to get the triplet back?</p>
