Tom Anderson <[EMAIL PROTECTED]> writes: >> Python does call by reference, which means that it passes pointers >> to objects by value. > That's not what call by reference is - call by reference is passing > pointers to *variables* by value.
In which case, Python can't do call-by-reference at all, because it doesn't have variable. Of course, I think call-by-reference is passing references to *objects* by value. > As a bonus, here's a similarly literal python translation of your C > program: > >>>> i = 1 >>>> ref = "i" >>>> i = 2 >>>> assert ref == "i" I claim that's not correct, because ref can be used to change i in any context in C. In your version, ref can only be used to change i if you have access to the namespace that i lives in. In my version, ref can't be used to change i at all. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list