tobias_k explained it already.
In short, using + instead of += changes the object directly and not the reference that's pointing towards it.
To quote it from the answer linked above:
When doing foo += something you're modifying the list foo in place,
thus you don't change the reference that the name foo points to, but
you're changing the list object directly. With foo = foo + something,
you're actually creating a new list.
Here is an example where this happens:
>>> alist = [1,2]
>>> id(alist)
4498187832
>>> alist.append(3)
>>> id(alist)
4498187832
>>> alist += [4]
>>> id(alist)
4498187832
>>> alist = alist + [5]
>>> id(alist)
4498295984
In your case, test got changed since p was a reference to test.
>>> test = [1,2,3,4,]
>>> p = test
>>> id(test)
4498187832
>>> id(p)
4498187832