title: How to access variable by id?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1396668/get-object-by-id">Get object by id()?</a>  </p>
  </blockquote>
  
  
  
  <pre><code>&gt;&gt;&gt; var = 'I need to be accessed by id!'
  &gt;&gt;&gt; address = id(var)
  &gt;&gt;&gt; print(address)
  33003240
  </code></pre>
  
  <p>Is there any way to use address of <code>var</code> in memory, provided by <code>id()</code>, for accessing value of <code>var</code>?</p>
  
  <p><strong>UPD:</strong><br>
  I also want to say, that if this cannot be done in standard Python, it also would be interesting, if this somehow could be implemented via hacking C++ internals of Python.</p>
  
  <p><strong>UPD2:</strong>
  Also would be interesting to know, how to <em>change</em> value of <code>var</code>.</p>