Pass by reference ?
jmg at ecs.soton.ac.uk
Wed Apr 5 10:27:04 CEST 2000
Jacek Generowicz wrote:
> I'm just trying to familiarize myself with Python.
> In Magnus Lie Hatland's Instant Python, he
> mentions that `all parameters in Python are passed
> by reference'.
Thank you for your answers.
I would welcome a critique of the following summary:
Python variables are implemented as references to
Assignment (potentially) alters the reference rather
than the value to which it refers.
Objects can be classified into two sets: mutalble and
Mutation of a mautable passed into a function will be
reflected in the mutation of the object which was
passed into the function; achieving similar behaviour
for immutables is more complicated.
More information about the Python-list