How do I operate on the actual object, not a copy, in a python for loop?
<p>let's say I have a list</p>

<pre><code>a = [1,2,3]
</code></pre>

<p>I'd like to increment every item of that list in place.  I want to do something as syntactically easy as</p>

<pre><code>for item in a:
    item += 1
</code></pre>

<p>but in that example python uses just the value of <code>item</code>, not its actual reference, so when I'm finished with that loop <code>a</code> still returns [1,2,3] instead of [2,3,4].  I know I could do something like </p>

<pre><code>a = map(lambda x:x+1, a)
</code></pre>

<p>but that doesn't really fit into my current code and I'd hate to have to rewrite it :-\</p>
