make a dic item reference a list item?
<p>Here is my problem:</p>

<pre><code>&gt;&gt;&gt; row0 = [0, 0, 0]
&gt;&gt;&gt; row1 = [0, 0, 0]
&gt;&gt;&gt; field = {'hor' : (row0[0], row1[0])}
&gt;&gt;&gt; field
{'hor': (0, 0)}
&gt;&gt;&gt; row0[0] = 1
&gt;&gt;&gt; field
{'hor': (0, 0)}
</code></pre>

<p>What I actually want to have would be:</p>

<pre><code>&gt;&gt;&gt; field
{'hor': (1, 0)}
</code></pre>

<p>I understand this behaviour, but how can I hack around it?</p>

<p>The only way I could think of was this:</p>

<p>I could store the ID of the items in the dictionary, like this:</p>

<pre><code>row0 = [0, 0]
row1 = [0, 0]
field = {'hor' : (id(row0[0]), id(row1[0]))}
</code></pre>

<p>But the problem here is the access to the variables by the id (I just need read access). I googled a bit, and the only possible solution I found was using globals().items(), like that:</p>

<pre><code>for key, value in globals().items(): print key, value, id(value)
</code></pre>

<p>I hope someone has a better solution for my problem. Thanks in advance!</p>

<p>EDIT:</p>

<p>Sorry, the first code example was a bit too simple. My case more looks like the example above.</p>
