Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.]

Simpleton support at superhost.gr
Mon Jun 17 11:50:20 EDT 2013


On 17/6/2013 2:58 μμ, Michael Torrie wrote:
> In python just think of assignment as making a name *be* an object.  And
> if you assign one name to another name, that makes both names be the
> same object.  When names are unbound (either they go out of scope or you
> manually unbind them), the objects they are bound to are garbage collected.

"Object" here being the memory location, right?
When we say a = 5

a = an easy way for calling that "fixed memory location" that holds our 
value, instead of calling it in binary format or in hex format.
This is the direct object a is pointing too. Correct?

5 = *this* is the indirect object that a outputs when we print a.

Are the above statements correct Michael?

a = 5
b = a

a <---> memory address
b <---> memory address

I like to think a and b as references to the same memory address



-- 
What is now proved was at first only imagined!



More information about the Python-list mailing list