passing by refference

Erik Max Francis max at alcyone.com
Thu May 15 18:44:30 EDT 2003


Brian Quinlan wrote:

> I think that you are being overly dogmatic. All argument passing can
> be
> labeled as call-by-value because, at some level, it must be i.e. my
> compiler generates the same code for:
> 
> void f(int *) and
> void f(int &)

But saying this all boils down to call-by-value misses the point. 
Distinctions between call-by-value and call-by-reference aren't about
the _implementation_, they're about the high-level behavior of the
language.

Python as a language is closer to call-by-reference than call-by-value,
but it's really best described as something in between or different,
since "references" in Python are bindings and don't have the same kind
of long-lasting meaning that they do in, say, C++.

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ My life was better before I knew you.
\__/  Edith Wharton (to Morton Fullerton)




More information about the Python-list mailing list