On Mon, 03 Nov 2008 19:33:52 -0700, Joe Strout wrote: > On Nov 3, 2008, at 5:27 PM, Marc 'BlackJack' Rintsch wrote: > >> Maybe this is a surprise for you, because we haven't discussed this in >> much detail in this group lately, but it applies to Python which does >> call-by-object or call-by-sharing. ;-) > > There's no such thing. Those are just terms made up by the Python > community to in place of the more standard "call-by-value" terminology > to make Python seem more mysterious than it really is.
I call bullshit on you. We've already shown you that the term call-by- sharing (a.k.a. call-by-object or call-by-object-sharing) goes back to the 1970s and such computer scientists as Barbara Liskov. The language CLU used the term back in 1974, and it is possible that CLU wasn't the first language to use it. That's over fifteen years before the first release of Python. This is not the first time it's been pointed out to you. And it won't be the last. And I predict that it will make no difference to you at all: you will still continue to pretend that Liskov et al aren't even worth acknowledging, and you will continue to make the asinine definition that the "value" of x following "x = 1" is 0x97b3250 rather than 1. > I guess you can > call it "purple bananas" if you want, but the behavior is exactly the > same as what every other language calls call-by-value. Again, I call bullshit. Python's behaviour is not the same as what Pascal, or C, calls call-by-value. It is what many Java people call "call- by-value", because they make the same idiotic definition that the value of a variable is some arbitrary and hidden reference to the thing of interest: "Java is call-by-value, where value means a reference to the actual value, except for primitives, where the value is the actual value." It is an idiotic definition, the sort of thing that only a very smart person can make, twisting the plain and intuitive meaning of value ("what is denoted by a symbol") just to avoid having to accept that there are more things in reality than their pet theory includes. It's not we Python folk who are guilty of misusing terminology, it is you and your fellow VB and Java folk who are misusing the term call-by-value to describe something which is nothing like call-by-value in Pascal and C. There is a simple test you can do: pass a value to a function, and have the function mutate that value. If the mutation appears in the caller's environment, then the value wasn't copied and it is not call-by- value. In Python: def mutate(alist): alist.append(1) L = [1, 2] mutate(L) # supposedly call by value assert L == [1, 2] If the assert statement fails (and it does), then no copy was made and Python is not call-by-value. So Python is not call-by-value, and it's not call-by-reference, so ... either Python doesn't exist, or it uses a different calling convention. -- Steven -- http://mail.python.org/mailman/listinfo/python-list