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 mark.dickinson
Recipients mark.dickinson, ughacks
Date 2010-02-26.09:18:20
SpamBayes Score 2.2473732e-05
Marked as misclassified No
Message-id <1267175902.75.0.0951876681083.issue8023@psf.upfronthosting.co.za>
In-reply-to
Content
This is a bug in your code, rather than in Python.

A simpler example, for the purposes of explanation:

>>> root, total = [0], []
>>> total.append(root)
>>> total  # good so far
[[0]]
>>> root[0] = 1   # modify root
>>> total  # note that total changes here!
[[1]]
>>> total.append(root)
>>> total
[[1], [1]]

In effect, total contains two references to the same list.  Modify that list, and you'll see those changes reflected in `total` as well.
History
Date User Action Args
2010-02-26 09:18:22mark.dickinsonsetrecipients: + mark.dickinson, ughacks
2010-02-26 09:18:22mark.dickinsonsetmessageid: <1267175902.75.0.0951876681083.issue8023@psf.upfronthosting.co.za>
2010-02-26 09:18:20mark.dickinsonlinkissue8023 messages
2010-02-26 09:18:20mark.dickinsoncreate