"always passes by reference"

Greg Weeks weeks at golden.dtc.hp.com
Sat Jul 29 20:51:25 EDT 2000


Martijn Faassen (m.faassen at vet.uu.nl) wrote:
: This seems to be where the confusion comes in. When people claim Python
: passes by value, because the *references* are being passed by value, 
: that seems to be just stating that the only thing the computer can pass
: in the end is numbers. If you say that, everything is by value and references
: are impossible, which seems to be a useless set of semantics.

Why useless?  It works well for me and others.  Lisp uses the same object
model as Python, and old Lispers never bothered with this "references"
business.  They managed fine.  And there are advantages.  For example,
these semantics allow me to say that Perl is call-by-reference while Python
is call-by-value, a very real distinction that IMO contributes to the
superiority of Python.

I started -- or at least leapt into -- this thread because at the very
least I think it is misleading for people to assert flatly that Python is
call-by-reference when from another point of view that is not the case.  On
the other hand, as much as I prefer my own viewpoint, I realize that it is
a matter of taste, and tastes are rarely changed as a result of newsgroup
discussions.

Greg



More information about the Python-list mailing list