Dan Armentrout added the comment:
Thank you for your quick explanation of this to me.
Dan
On Tue, Nov 6, 2018 at 8:04 AM Steven D'Aprano
wrote:
>
> Steven D'Aprano added the comment:
>
> This is not a bug, this is standard behaviour, working as designed.
>
> 'a' is not a copy of the list '
Steven D'Aprano added the comment:
This is not a bug, this is standard behaviour, working as designed.
'a' is not a copy of the list 'x', 'a' is another name for the same list as
'x'. Any in-place modifications you make to 'a' happens to the object itself,
the list, which is visible regardle
New submission from Dan Armentrout :
If you run the following code:
x=[3,4,5]
a=x
for i in range(0,len(a)):
a[i]=0
All x values are changed to equal a.
--
components: Windows
messages: 329357
nosy: darmentr, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: