[issue39110] UserList-subclass Tree slicing changes the original list unexpectedly

2019-12-20 Thread ctarn
ctarn added the comment: Moreover, 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. I didn't try it using Python 3.9 yet. -- versions: +Python 3.7 -Python 3.9 ___ Python tracker

[issue39110] UserList-subclass Tree slicing changes the original list unexpectedly

2019-12-20 Thread ctarn
Change by ctarn : Removed file: https://bugs.python.org/file48797/bug.py ___ Python tracker <https://bugs.python.org/issue39110> ___ ___ Python-bugs-list mailin

[issue39110] UserList-subclass Tree slicing changes the original list unexpectedly

2019-12-20 Thread ctarn
ctarn added the comment: I tried to remove list(), and just use cmd like `_ = d[0:1]`, and it surprisingly changed d[0].owner from d to d[0:1]! The file attached is updated. I pretty sure that it is a (serious) bug. Please check it more carefully. Thanks. -- title: UserList-subclass

[issue39110] UserList-subclass Tree slicing changes node attribute

2019-12-20 Thread ctarn
Change by ctarn : -- resolution: not a bug -> ___ Python tracker <https://bugs.python.org/issue39110> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue39110] UserList-subclass Tree slicing changes node attribute

2019-12-20 Thread ctarn
ctarn added the comment: Sorry but it is not. See the first time I print ls[4].owner. We get d as expected, not a slice of d, that is, d[0:2]. However the next time we print it after _ = list(d[0:1]), noticed that ls[4] == d[0:1], we get d[0:1], it’s extremely surprising!!! I have

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

2019-12-20 Thread ctarn
ctarn added the comment: OK, I mean... when I call `a = list(b)`, list() changes `b` unexpectedly, not `a != b` in this case. That is why I replace the left operand with `_`. -- ___ Python tracker <https://bugs.python.org/issue39

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

2019-12-20 Thread ctarn
ctarn added the comment: I printed the value of *.owner before and after `_ = list(d...)`, and marked the results in the comments. -- ___ Python tracker <https://bugs.python.org/issue39

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

2019-12-20 Thread ctarn
ctarn added the comment: Hi, thanks. It did call `list()` through `_ = list(d[0:2])` -- ___ Python tracker <https://bugs.python.org/issue39110> ___ ___ Pytho

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

2019-12-20 Thread ctarn
ctarn 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

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

2019-12-20 Thread ctarn
Change by ctarn : -- title: It seems that unittest.TestCase.assertListEqual changes the value of its parameters -> It seems that list() changes the value of the parameter Added file: https://bugs.python.org/file48797/bug.py ___ Python trac

[issue39110] It seems that unittest.TestCase.assertListEqual changes the value of its parameters

2019-12-20 Thread ctarn
Change by ctarn : Removed file: https://bugs.python.org/file48796/bug.py ___ Python tracker <https://bugs.python.org/issue39110> ___ ___ Python-bugs-list mailin

[issue39110] It seems that unittest.TestCase.assertListEqual changes the value of its parameters

2019-12-20 Thread ctarn
New submission from ctarn : Sorry, it is caused by list(). I will update the issue very soon. -- nosy: +ctarn ___ Python tracker <https://bugs.python.org/issue39

[issue39110] It seems that unittest.TestCase.assertListEqual changes the value of its parameters

2019-12-20 Thread ctarn
Change by ctarn : -- title: It seems that TestCase.assertListEqual change the value of its parameters -> It seems that unittest.TestCase.assertListEqual changes the value of its parameters ___ Python tracker <https://bugs.python.org/issu

[issue39110] It seems that TestCase.assertListEqual change the value of its parameters

2019-12-20 Thread ctarn
Change by ctarn : -- nosy: -ctarn title: It -> It seems that TestCase.assertListEqual change the value of its parameters versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issu

[issue39110] It

2019-12-20 Thread ctarn
Change by ctarn : -- files: bug.py nosy: ctarn priority: normal severity: normal status: open title: It type: behavior Added file: https://bugs.python.org/file48796/bug.py ___ Python tracker <https://bugs.python.org/issue39