Call by binding [was Re: [Tutor] beginning to code]

Bill BILL_NOSPAM at whoknows.net
Mon Sep 25 23:46:10 EDT 2017


Chris Angelico wrote:
> On Tue, Sep 26, 2017 at 5:35 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
>> Chris Angelico <rosuav at gmail.com>:
>>
>>> On Tue, Sep 26, 2017 at 12:26 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
>>> Sorry, that was my bad in the terminology. But where do you get that
>>> all Python expressions evaluate to pointers?
>> What do they evaluate to if not pointers? Anton's "identities" would
>> work, too. "Address" would do, as well. I have previously proposed the
>> term "leash." Call it "link" or "handle" or "arrow" if you want to.
>>
>> The term used isn't important. What's important is to understand that
>> each expression and subexpression produces and operates on pointers.
> They evaluate to objects. Not to pointers to objects. Not to
> references to objects. To objects. Expressions evaluate to actual
> objects, and when you assign "name = value", you bind the name to the
> object that value evaluates to.
>
> ChrisA

And when you pass a reference r to a function, a copy of the reference 
is passed. So even if you reassign *that* copy of r to refer to another 
object, upon return, r still still refers to whatever it did 
originally.  ::: case closed :::, I think.



More information about the Python-list mailing list