MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnmachinelearning/comments/1x89fg6/python_mutability_and_copying/phb9m77/?context=3
r/learnmachinelearning • u/Sea-Ad7805 • Oct 17 '26
12 comments sorted by
View all comments
-1
a and b are both pointers to the same memory location.
copy.deepcopy() will copy a and create b in a separate memory location.
1 u/Smallpaul Oct 17 '26 edited Oct 17 '26 It’s not helpful to give an answer in the comments. Especially a wrong answer. -2 u/FastSlow7201 Oct 17 '26 edited Oct 17 '26 I'm not wrong. Do you know how to code in C and can look at this python code and see the C code that it is producing? 1 u/Sea-Ad7805 Oct 17 '26 What's the C code that you can see?
1
It’s not helpful to give an answer in the comments. Especially a wrong answer.
-2 u/FastSlow7201 Oct 17 '26 edited Oct 17 '26 I'm not wrong. Do you know how to code in C and can look at this python code and see the C code that it is producing? 1 u/Sea-Ad7805 Oct 17 '26 What's the C code that you can see?
-2
I'm not wrong. Do you know how to code in C and can look at this python code and see the C code that it is producing?
1 u/Sea-Ad7805 Oct 17 '26 What's the C code that you can see?
What's the C code that you can see?
-1
u/FastSlow7201 Oct 17 '26
a and b are both pointers to the same memory location.
copy.deepcopy() will copy a and create b in a separate memory location.