Why in python list += [elem] modifies the original list?
<pre><code>&gt;&gt;&gt; list1 = []
&gt;&gt;&gt; list2 = list1
&gt;&gt;&gt; list2 += [1]
&gt;&gt;&gt; print list1
[1]
</code></pre>

<p>Comparing this to</p>

<pre><code>&gt;&gt;&gt; list1 = []
&gt;&gt;&gt; list2 = list1
&gt;&gt;&gt; list2 = list2 + [1]
&gt;&gt;&gt; print list1
[]
</code></pre>

<p>Is there a reason why the '+='-operation modifies the original list?</p>

<p><strong>EDIT: just to make my question a bit clearer</strong></p>

<p>In most of the languages that I know the '+='-operator doesn't work this way and I would like to know why it was designed in this way in python.</p>

<p>some examples:</p>

<p>Ruby</p>

<pre><code>irb(main):001:0&gt; l = []
irb(main):002:0&gt; a = l
irb(main):003:0&gt; a += [2]
irb(main):004:0&gt; l
=&gt; []
</code></pre>

<p>Scala etc..</p>
