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 pablogsal
Recipients dev40573, pablogsal
Date 2019-10-13.00:41:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1570927269.34.0.35998456506.issue38458@roundup.psfhosted.org>
In-reply-to
Content
Hi Devor,

This is not a bug in Python but indeed documented behavior. When you do

p=l

you are creating a new reference to the same list ([2,3,4]), so changing one changes the other. If you want to make a copy you can do

p = l.copy()
History
Date User Action Args
2019-10-13 00:41:09pablogsalsetrecipients: + pablogsal, dev40573
2019-10-13 00:41:09pablogsalsetmessageid: <1570927269.34.0.35998456506.issue38458@roundup.psfhosted.org>
2019-10-13 00:41:09pablogsallinkissue38458 messages
2019-10-13 00:41:09pablogsalcreate