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 tr
Change by ctarn :
Removed file: https://bugs.python.org/file48797/bug.py
___
Python tracker
<https://bugs.python.org/issue39110>
___
___
Python-bugs-list mailin
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
Change by ctarn :
--
resolution: not a bug ->
___
Python tracker
<https://bugs.python.org/issue39110>
___
___
Python-bugs-list mailing list
Unsubscrib
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 to
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
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
ctarn added the comment:
Hi, thanks. It did call `list()` through `_ = list(d[0:2])`
--
___
Python tracker
<https://bugs.python.org/issue39110>
___
___
Pytho
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
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
Change by ctarn :
Removed file: https://bugs.python.org/file48796/bug.py
___
Python tracker
<https://bugs.python.org/issue39110>
___
___
Python-bugs-list mailin
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
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
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
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
15 matches
Mail list logo