How does python return list from functions? List passed is immutable?
<pre><code>def insertion_sort(A):
    for j in range(1, len(A)):
        key = A[j]
    i = j - 1
    while (i &gt;= 0) and (A[i] &gt; key):
        A[i+1] = A[i]
        i = i-1
    A[i+1] = key

    return A


print insertion_sort([8, 1, 3, 4, 9, 5, 2])
</code></pre>

<p>Now this prints: <code>[8, 1, 3, 4, 9, 5, 2]</code></p>

<p>But I assume, I am mutating the list A, then why is the return value the same?</p>
