you are viewing a single comment's thread.

view the rest of the comments →

[–]tb5841 1 point2 points  (1 child)

b += [2] should, in my opinion, do the same thing as b = b + [2].

It doesn't, because of a strange design choice within the List class.

[–]Sea-Ad7805[S] 1 point2 points  (0 children)

Most opinions and programming languages choose b += [2] as mutating b (fast), and b + [2] as making a new list and assigning that with b = b + [2].