passing by refference

Donn Cave donn at drizzle.com
Wed May 21 01:10:08 EDT 2003


Quoth "Greg Ewing (using news.cis.dfn.de)" <g2h5dqi002 at sneakemail.com>:
| Tim Peters wrote:
|> The notion of object identity is also important.  The call-by-object
|> business explicitly addresses all of them (read Liskov or Baker, previously
|> referenced).  By itself, "call by value" doesn't;
|
| What would y'all think of the following way of phrasing
| it:
|
|     Python passes references to objects by value.
|
| It seems to me that the concept of passing something by
| value, as opposed to passing it by reference, applies
| perfectly well to Python. We just need a way of referring
| to the concept while making it clear *what* it is that's
| being passed. I think the above phrasing achieves that.
| Does anyone agree?

I'm with Terry on this one, we really do not need to make clear
what (kind of value) is being passed.  People coming from the
realm of languages where "by value" means something important,
just have to let go of that, and we can help by staying away
from the term.

| P.S. I make no apology for using the word "reference"
| either, since I'm also stating what the reference is
| referring to. I don't understand why there is so much
| opposition to using this word when talking about Python.
| I maintain that, to correctly understand Python's data
| model, you need some concept in your brain that's
| functionally equivalent to a reference -- so why not
| call it that?

Quite.  Everyone uses reference, even the people who say
they don't.  I bet its natural comprehensibility, I mean
the match between its common meaning(s) and its Python
technical meaning, is equal to binding.  Nothing wrong
with "binding" in informal usage (the two used together
are even better), but the technical word for the thing is
reference.

	Donn Cave, donn at drizzle.com




More information about the Python-list mailing list