Python append() vs. + operator on lists, why do these give different results?
Why do these two operations ( append() resp. + ) give different results? >>> c = [1, 2, 3] >>> c [1, 2, 3] >>> c += c >>> c [1, 2, 3, 1, 2, 3] >>> c = [1, 2, 3] >>> c.append(c) >>> c [1, 2, 3, [...]] >>> In the last case there's actually an infinite recursion. c[-1] and c are the same. Why is it different with the + operation? Abel To explain "why": The + operation adds the array elements to the original array. The array.append operation inserts the array (or any object) into the end of the original array, which results in a reference to self in that spot (hence the infinite recursion). The