Access deep list nested values by reference in Python
<p>I have a list with nested lists and I want to create a function (<code>modify_list</code>) that gets a tuple and modifies the passed pointer with a passed value argument. The problem is that I'm not sure how to modify a nested value like this programmatically by reference.</p>

<p>Simplified example:</p>

<pre><code>l = [[1, [2,3, [4,5,6]]]]
</code></pre>

<p>If I call the function <code>modify_list</code>, these would be how to use it and the expected results:</p>

<pre><code>&gt; l[0][1][2][2]
6

&gt; modify_list((0, 1, 2, 2), 8)
&gt; l
[[1, [2,3, [4,5,8]]]]

&gt; modify_list((0, 1, 1), 14)
&gt; l
[[1, [2,14, [4,5,8]]]]
</code></pre>

<p>Thanks</p>
