|
|
|
|
|
by Joeboy
1295 days ago
|
|
Perhaps I'm being simple minded, but the id of the passed object within the function is the same as the id of the object outside the function, no? My mental model is that an object's id in python is basically an address / pointer. So, how come it's the same inside the function as outside, if it's not pass by reference? |
|
Here's an example to include the id differences and the fact that a does not take on the value of d:
But, as I've posted elsewhere in this thread, this example will change the contents of 'd' since d itself is not being set, its contents are: