3 ms·
I'm not re-using the name 'd', I'm assigning to the already-existing parameter d. Which if d was indeed a reference would result in the variable passed to the f
by rockemsockem 4y ago
I'm not re-using the name 'd', I'm assigning to the already-existing parameter d. Which if d was indeed a reference would result in the variable passed to the function being changed.
In explaining this I decided to check the Python docs and learned a new piece of terminology "pass by assignment", which is how Python explains its variable passing scheme: https://docs.python.org/3/faq/programming.html#how-do-i-write-a-function-with-output-parameters-call-by-reference https://docs.python.org/3/faq/programming.html#how-do-i-writ...