Message100142
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. |
|
Date |
User |
Action |
Args |
2010-02-26 09:18:22 | mark.dickinson | set | recipients:
+ mark.dickinson, ughacks |
2010-02-26 09:18:22 | mark.dickinson | set | messageid: <1267175902.75.0.0951876681083.issue8023@psf.upfronthosting.co.za> |
2010-02-26 09:18:20 | mark.dickinson | link | issue8023 messages |
2010-02-26 09:18:20 | mark.dickinson | create | |
|