Python: How to create a common element between a list and a dict
<p>I am new to data structures in python and was wondering how do you simulate a thing like pointers in python so that multiple structures can refer and manage the same piece of data.</p>

<p>I have the following two structures</p>

<pre><code>my_list = [1]
my_dictionary = {}
my_dictionary["hello"] = my_list[0]
</code></pre>

<p>and when I do the following I get True</p>

<pre><code> id(my_dictionary["hello"]) == my_list[0]
</code></pre>

<p>However how can I force removal both from the dict and the list in one go?
If I do the following my_dictionary still has a reference to my_list[0] i.e. 1</p>

<pre><code>del my_list[0]
</code></pre>

<p>is there a way to get rid of both of these elements in one go? What is the python way of doing linked structures like this?</p>