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 zach.ware
Recipients Sai.Krishna.G, zach.ware
Date 2014-08-02.21:34:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1407015269.87.0.996462401324.issue22124@psf.upfronthosting.co.za>
In-reply-to
Content
This is not a bug. The assignment "a = nums" doesn't create a copy of "nums", it just assigns the name "a" to the same object that "nums" refers to.  Since lists are mutable, changes made to "a" are visible through the name "nums".  By the time you do "a[2] = nums[0]", "nums[0]" has been reassigned.

Have a look at this article: http://nedbatchelder.com/text/names.html

Also, you may want to look at collections.deque and its rotate method.
History
Date User Action Args
2014-08-02 21:34:29zach.waresetrecipients: + zach.ware, Sai.Krishna.G
2014-08-02 21:34:29zach.waresetmessageid: <1407015269.87.0.996462401324.issue22124@psf.upfronthosting.co.za>
2014-08-02 21:34:29zach.warelinkissue22124 messages
2014-08-02 21:34:29zach.warecreate