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.

Author steven.daprano
Recipients dev40573, steven.daprano
Date 2019-10-13.00:44:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1570927456.17.0.430647374722.issue38458@roundup.psfhosted.org>
In-reply-to
Content
This is not a bug, it is part of the design of the language. Assignment in Python does not make a copy of lists, or any other object. In your sample code, p and l are two names for the same list, like "Devor Blake Daniels" and "dev40573" are two names for the same person (you).

You can use slicing to make a copy of the list, or the copy module, or the list constructor.

I don't understand your comment "when dealing with lists like s[][],slicing does not work".
History
Date User Action Args
2019-10-13 00:44:16steven.dapranosetrecipients: + steven.daprano, dev40573
2019-10-13 00:44:16steven.dapranosetmessageid: <1570927456.17.0.430647374722.issue38458@roundup.psfhosted.org>
2019-10-13 00:44:16steven.dapranolinkissue38458 messages
2019-10-13 00:44:16steven.dapranocreate