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

Simpleton support at superhost.gr
Mon Jun 17 07:34:57 EDT 2013


On 17/6/2013 9:51 πμ, Steven D'Aprano wrote:
> Now, in languages like Python, Ruby, Java, and many others, there is no
> table of memory addresses. Instead, there is a namespace, which is an
> association between some name and some value:
>
> global namespace:
>      x --> 23
>      y --> "hello world"

First of all thanks for the excellent and detailed explanation Steven.

As for namespace:

a = 5

1. a is associated to some memory location
2. the latter holds value 5

So 'a', is a reference to that memory location, so its more like a name 
to that memory location, yes? Instead of accessing a memory address with 
a use of an integer like "14858485995" we use 'a' instead.

So is it safe to say that in Python a == &a ? (& stands for memory address)

is the above correct?

I say this because here you said that: Instead, there is a namespace, 
which is anassociation between some name and some value:

When you say that you mean that a is associated to some value as in 
memory location or to that memory location's address?



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



More information about the Python-list mailing list