New submission from Antara :
o= [1,2,3,3]
print('o:',id(o))
d= o
print('d:',id(d))
d= [1,2,3,4]
dd= o
print('dd:',id(dd))
dd[3]= 5
print('o:',o)
print('d:',d)
print('dd:',dd)
===
Output:
o: 1976210449032
d: 1976210449032
dd: 1976210449032
o: [1, 2, 3, 5]
d: [1, 2, 3, 4]
dd: [1, 2, 3, 5]
Though o,d and dd points to the same memory pointer but d has different value.
How can same memory location points to 2 different values?
--
messages: 408998
nosy: antarab
priority: normal
severity: normal
status: open
title: List reference not working properly
type: behavior
___
Python tracker
<https://bugs.python.org/issue46145>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com