This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author antarab
Recipients antarab
Date 2021-12-21.17:24:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1640107485.01.0.343364222268.issue46145@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2021-12-21 17:24:45antarabsetrecipients: + antarab
2021-12-21 17:24:45antarabsetmessageid: <1640107485.01.0.343364222268.issue46145@roundup.psfhosted.org>
2021-12-21 17:24:44antarablinkissue46145 messages
2021-12-21 17:24:44antarabcreate