New submission from annoywife:
When executing the following code, I would expect the 3 to be removed from
list_copy while list_original remains unaltered. However, list_copy.pop()
removes the 3 from both lists. If an index is specified for pop, this behavior
occurs as well.
list_original =
R. David Murray added the comment:
https://docs.python.org/3/faq/programming.html#why-did-changing-list-y-also-change-list-x
--
nosy: +r.david.murray
resolution: - not a bug
stage: - resolved
status: open - closed
___
Python tracker