O'Reilly logo
  • You Wang thinks this is interesting:

For function arguments, we can always copy the list at the point of call, with tools like list, list.copy as of 3.3, or an empty slice:


Cover of Learning Python, 5th Edition


use list slicing to pass a whole new copy of list to function, instead reference to the original list