|
|
|
|
|
by Joeboy
1295 days ago
|
|
My understanding of what's going on with python is it passes by reference (hence what your code does), but if the data type is immutable any modification results in a new instance being created in the scope of the function, and the object passed in is not modified. Which mostly looks like pass-by-value behaviour. I guess my understanding could be technically wrong in some way, but it seems to reflect what happens. |
|