r/learnmachinelearning • • Oct 17 '26

Question Python Mutability and Copying

Post image
0 Upvotes

12 comments sorted by

View all comments

-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.

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

u/Relevant-Yak-9657 Oct 17 '26

How did you manage to be wrong then? It isn't answer D.