[issue39110] It seems that list() changes the value of the parameter

ctarn report at bugs.python.org
Fri Dec 20 10:23:33 EST 2019


ctarn <i at ctarn.io> added the comment:

In the code, each item of ls = [[0], [1], [2],...] has an owner pointing to d, which is a Tree inheriting from collections.UserList.
When `d[0] = a`, and `a.owner = d`, and `_ = list(d[0:1])` is called, a.owner will be changed to d[0:1].

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39110>
_______________________________________


More information about the Python-bugs-list mailing list