I found another difference:
a = [1]
def func():
a.extend([2])
func()
UnboundLocalError: local variable 'a' referenced before assignment
a = [1]
def func():
a += [2]
func()
The Python interpreter seems to assume that a
is a local variable through a += [2]
.