I was wondering: is there any difference between these two methods of appending an element to a list in python:
L = L + [1]
and L.append(1)
?
I mean in a computational way : for example maybe the first method reallocate memory for a new list with size + 1 then copies the content of L into it then append 1
. Or is it rather a linked list where we update the pointer of the next element in the last item of the list. In the latter I think there is no difference (or is there any ?)
Thanks