Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'value,': 0.04; 'cpython': 0.05; 'interpreter': 0.05; 'binary': 0.07; 'puts': 0.07; "'a'": 0.09; 'explanation': 0.09; 'latter': 0.09; 'ruby,': 0.09; 'sentence': 0.09; 'subject: [': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'stored': 0.12; '"hello': 0.16; 'address)': 0.16; 'call?': 0.16; 'namespace,': 0.16; 'reedy': 0.16; 'referencing': 0.16; 'subject:versus': 0.16; 'java,': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'code,': 0.22; 'memory': 0.22; 'cc:addr:python.org': 0.22; 'integer': 0.24; 'interpret': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'holds': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'locations': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; '(which': 0.31; '>>>>': 0.31; "d'aprano": 0.31; 'stands': 0.31; 'steven': 0.31; 'this.': 0.32; 'languages': 0.32; 'url:python': 0.33; 'not.': 0.33; 'actual': 0.34; 'table': 0.34; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'url:listinfo': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'level': 0.37; 'received:209': 0.37; 'being': 0.38; 'does': 0.39; 'called': 0.40; 'url:mail': 0.40; 'how': 0.40; 'read': 0.60; 'tell': 0.60; 'lost': 0.61; 'first': 0.61; 'back': 0.62; 'address': 0.63; 'name': 0.63; 'high': 0.63; 'here': 0.66; 'between': 0.67; 'detail.': 0.68; 'study': 0.69; 'safe': 0.72; 'to,': 0.72; 'physical': 0.72; 'indirect': 0.84; 'subject:gets': 0.84; 'to:addr:support': 0.84; 'joel': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=HqbjCx2BE4ofH8H1Fu5/PtqxliA0RdAUkkOWgb5RP4c=; b=qTisM3P4GcV25ezDq7W1xGCqzRvIb/ib7snxZK/amGaPB+WehLfr1Mc6ooBky7whdL HKmF/dEK89hYQgjV/e3ASdBSw1qlouEqfWaxo6U+TgGSe97w9DGyvrqNR3lt1IXpO1zo KJ/fxgiZldttwckS/f03LegnTL1Z1EwniyuU21R2/dC9syUYw1PYByIufULyrWmWXwpv 3a5f1JI8/B2aJVl6VU1lj56Ky6TNnIBBMZirpWXgZxor5+MDnSgf1QhwqxFfbEa+TIKz c1A9Fl3wbD5OnFJafDV9hsrNskoyOlDnDVmW+ciXimzGgqwmwzCJ7JNN4tmJziYGB0Hy qUjw== MIME-Version: 1.0 X-Received: by 10.58.187.232 with SMTP id fv8mr4767902vec.50.1371486398262; Mon, 17 Jun 2013 09:26:38 -0700 (PDT) In-Reply-To: References: <2bc90d3b-09c2-4315-9357-ff7f039465e0@googlegroups.com> <51bb454c$0$29997$c3e8da3$5496439d@news.astraweb.com> <51beb20c$0$29872$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 17 Jun 2013 12:26:38 -0400 Subject: Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] From: Joel Goldstick To: Simpleton Content-Type: multipart/alternative; boundary=047d7b6dc4a095684204df5c0fd2 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 174 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371486406 news.xs4all.nl 16002 [2001:888:2000:d::a6]:42600 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48532 --047d7b6dc4a095684204df5c0fd2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Jun 17, 2013 at 11:55 AM, Simpleton wrote: > On 17/6/2013 5:22 =CE=BC=CE=BC, Terry Reedy wrote: > >> On 6/17/2013 7:34 AM, Simpleton wrote: >> >>> On 17/6/2013 9:51 =CF=80=CE=BC, Steven D'Aprano wrote: >>> >>>> Now, in languages like Python, Ruby, Java, and many others, there is n= o >>>> 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 =3D 5 >>> >>> 1. a is associated to some memory location >>> 2. the latter holds value 5 >>> >> >> This is backwards. If the interpreter puts 5 in a *permanent* 'memory >> location' (which is not required by the language!), then it can >> associate 'a' with 5 by associating it with the memory location. CPython >> does this, but some other computer implementations do not. >> > > Please tell me how do i need to understand the sentence > 'a' is being associated with number 5 in detail. > > Why don't we access the desired value we want to, by referencing to that > value's memory location directly instead of using namespaces wich is an > indirect call? > > i feel we have 3 things here > > a , memory address of a stored value, actual stored value > > So is it safe to say that in Python a =3D=3D &a ? (& stands for memory >>> address) >>> >>> is the above correct? >>> >> >> When you interpret Python code, do you put data in locations with >> integer addresses? >> > > I lost you here. > > > > -- > What is now proved was at first only imagined! > -- > http://mail.python.org/**mailman/listinfo/python-list > Read and study this. Then come back and ask again. Don't think of physical representation of memory with actual binary addresses. Python is not assembler. Neither is it C (sometimes called high level assembler) http://docs.python.org/2/tutorial/classes.html#python-scopes-and-namespaces --=20 Joel Goldstick http://joelgoldstick.com --047d7b6dc4a095684204df5c0fd2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Mon, Jun 17, 2013 at 11:55 AM, Simpleton <<= a href=3D"mailto:support@superhost.gr" target=3D"_blank">support@superhost.= gr> wrote:
On 17/6= /2013 5:22 =CE=BC=CE=BC, Terry Reedy wrote:
On 6/17/2013 7:34 AM, Simpleton wrote:
On 17/6/2013 9:51 =CF=80=CE=BC, 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:
=C2=A0 =C2=A0 =C2=A0x --> 23
=C2=A0 =C2=A0 =C2=A0y --> "hello world"

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

As for namespace:

a =3D 5

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

This is backwards. If the interpreter puts 5 in a *permanent* 'memory location' (which is not required by the language!), then it can
associate 'a' with 5 by associating it with the memory location. CP= ython
does this, but some other computer implementations do not.

Please tell me how do i need to understand the sentence
'a' is being associated with number 5 in detail.

Why don't we access the desired value we want to, by referencing to tha= t value's memory location directly instead of using namespaces wich is = an indirect call?

i feel we have 3 things here

a , memory address of a stored value, actual stored value

So is it safe to say that in Python a =3D=3D &a ? (& stands for mem= ory
address)

is the above correct?

When you interpret Python code, do you put data in locations with
integer addresses?

I lost you here.



--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Read and study this.=C2=A0 Then come= back and ask again.=C2=A0 Don't think of physical representation of me= mory with actual binary addresses.=C2=A0 Python is not assembler.=C2=A0 Nei= ther is it C (sometimes called high level assembler)
http://docs.python.org/2/tutorial/classes.html#python-scopes-a= nd-namespaces

--
--047d7b6dc4a095684204df5c0fd2--