title: Python throws error, but still mutates tuple - is this a Python REPL bug?
body: <p>With the following code, we can see that the modify operation in the last line fails - Python throws an error <code>TypeError: 'tuple' object does not support item assignment</code></p>
  <p>However, if we look at the line below and print <code>a</code>, we see that it <em>did</em> indeed do the operation of <code>+= [1]</code>.</p>
  <p>Why is this? Shouldn't the variable <code>a</code> <em>not</em> be mutated if the REPL gives an error?</p>
  <pre><code>[nhouk@computer:~] $ python3
  Python 3.5.3 (default, Nov  4 2021, 15:29:10) 
  [GCC 6.3.0 20170516] on linux
  Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
  &gt;&gt;&gt; a = ([2, 3], &quot;a&quot;, &quot;b&quot;)
  &gt;&gt;&gt; a[0] += [1]
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  TypeError: 'tuple' object does not support item assignment
  &gt;&gt;&gt; a
  ([2, 3, 1], 'a', 'b')
  </code></pre>