Skip to content

Instantly share code, notes, and snippets.

@y56
Created January 27, 2020 07:56
Show Gist options
  • Save y56/55f6fd58f59cad631f12019fa9e4032f to your computer and use it in GitHub Desktop.
Save y56/55f6fd58f59cad631f12019fa9e4032f to your computer and use it in GitHub Desktop.
= =
= =
https://robertheaton.com/2014/02/09/pythons-pass-by-object-reference-as-explained-by-philip-k-dick/
This article makes things complicated.
Forget about the box metaphore in it.
Variablea are copied to functions by address.
Inside a function, while some operations (like .append()) are applied through dereferencing ,
others like reassignment are done by assigning a new address.
That's it. Nothing more.
https://robertheaton.com/2014/02/09/pythons-pass-by-object-reference-as-explained-by-philip-k-dick/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment