Mark Dickinson <dicki...@gmail.com> added the comment: [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. ---------- nosy: +mark.dickinson resolution: -> not a bug status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39110> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com