fredrik at pythonware.com
Mon Dec 13 17:58:49 CET 2004
Nick Coghlan wrote:
> Python could be said to pass everything by reference. You are getting caught more by the
> difference between mutable and immutable types, than by the distinction between 'pass by
> reference' and 'pass by value' that other languages have (Python actually uses a blend of the two
> ideas - you get references passed in, but it you use assignment on your arguments, the caller is
> not affected).
to avoid confusing people who (think they) know exactly what "call by value"
and "call by reference" means, the preferred term is "call by object".
for some background, see
(in earlier literature, Python's model is often called "call by sharing". this model is
in fact closer to "call by value" than "call by reference", at least if you stick to the
More information about the Python-list