Message358768
[ctarn]
> it works as expected with Python 3.6 (the owner of each of them is d), and Python 3.8 and Python 3.7 work differently
The change in behaviour is the result of a bug fix that was applied in 3.7 and upwards: see GH-13169 and #27639.
As Eric says, UserList is behaving as intended here. Your problem stems from a design flaw in your code, namely that Nodes have owners. If a node exists both in a Tree *and* in a slice of that Tree (which slice, since the #27639 fix, is again a Tree), that node can't have both the original Tree *and* the slice as owner. In this case, what's happening is that accessing `d[0:1]` creates a new Tree object, and the __init__ method for that Tree object then reassigns the "owner" of the node in that slice.
> I don’t know what is discussion list
See https://www.python.org/community/lists/, and particularly https://mail.python.org/mailman/listinfo/python-list
Closing again here, but feel free to start a discussion or ask questions on the list above. |
|
Date |
User |
Action |
Args |
2019-12-21 11:55:33 | mark.dickinson | set | recipients:
+ mark.dickinson, terry.reedy, steven.daprano, eric.snow, ctarn |
2019-12-21 11:55:33 | mark.dickinson | set | messageid: <1576929333.21.0.923981259038.issue39110@roundup.psfhosted.org> |
2019-12-21 11:55:33 | mark.dickinson | link | issue39110 messages |
2019-12-21 11:55:32 | mark.dickinson | create | |
|