This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Equalized lists depend to each other after equalizing
Type: behavior Stage: resolved
Components: Versions: Python 3.8
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Code7737, eric.smith
Priority: normal Keywords:

Created on 2021-10-02 13:23 by Code7737, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Test.py Code7737, 2021-10-02 13:23
Test.py Code7737, 2021-10-02 13:25
Test.py Code7737, 2021-10-02 13:26
Messages (2)
msg403052 - (view) Author: (Code7737) Date: 2021-10-02 13:23
When you make two lists same by using "=" and then change one of them, other changes too
msg403053 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2021-10-02 13:38
This isn't a bug. In python, the assignment doesn't make a copy, it makes ts and s refer to the same object. So there's really only one list to change, and you can refer to it by either name, ts or s.
History
Date User Action Args
2022-04-11 14:59:50adminsetgithub: 89508
2021-10-02 13:38:29eric.smithsetstatus: open -> closed

nosy: + eric.smith
messages: + msg403053

resolution: not a bug
stage: resolved
2021-10-02 13:26:27Code7737setfiles: + Test.py
2021-10-02 13:25:27Code7737setfiles: + Test.py
2021-10-02 13:23:36Code7737create