title: Multiple assignment with Numpy arrays and lists, a curious example
body: <p>Consider the multiple assignment <code>x[0],y = y,x[0]</code>. Applied to each of the four below cases, this gives four different results.</p>
  
  <ul>
  <li><p>Case 1:</p>
  
  <pre><code>x = [[1,2], [3,4]]
  y = [5,6]
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>x = [[5,6], [3,4]]
  y = [1,2]
  </code></pre></li>
  <li><p>Case 2:</p>
  
  <pre><code>x = np.array([[1,2], [3,4]])
  y = [5,6]
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>x = array([[5,6], [3,4]])
  y = array([5,6])
  </code></pre></li>
  <li><p>Case 3:</p>
  
  <pre><code>x = [[1,2], [3,4]]
  y = np.array([5,6])
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>x = [array([5,6]), [3,4]]
  y = [1,2]
  </code></pre></li>
  <li><p>Case 4:</p>
  
  <pre><code>x = np.array([[1,2], [3,4]])
  y = np.array([5,6])
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>x = array([[5,6], [3,4]])
  y = array([5,6])
  </code></pre></li>
  </ul>
  
  <p>It appears that the multiple assignment of lists is smarter (going through a temporary variable automatically) than the multiple assignment of Numpy arrays. </p>
  
  <p>Thoughts?</p>
  
  <p><strong>EDIT:</strong> It is not smarter afterall...</p>