Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'interpreter': 0.05; 'say,': 0.05; 'assign': 0.07; 'assignment': 0.07; 'pointers': 0.09; 'subject: [': 0.09; 'python': 0.11; '(either': 0.16; 'address)': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'garbage': 0.16; 'interpreter,': 0.16; 'namespace,': 0.16; 'subject:versus': 0.16; 'unbind': 0.16; 'unbound': 0.16; 'wrote:': 0.18; 'memory': 0.22; 'header:User- Agent:1': 0.23; 'certainly': 0.24; 'equivalent': 0.26; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'concern': 0.31; 'object.': 0.31; 'stands': 0.31; 'another': 0.32; 'level.': 0.33; 'not.': 0.33; 'something': 0.35; 'objects': 0.35; 'but': 0.35; 'there': 0.35; 'doing': 0.36; 'should': 0.36; 'message-id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'manually': 0.60; 'making': 0.63; 'name': 0.63; 'details': 0.65; 'here': 0.66; 'between': 0.67; 'safe': 0.72; 'yourself': 0.78; 'low': 0.83; 'partially': 0.84; 'subject:gets': 0.84 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Mon, 17 Jun 2013 05:58:41 -0600 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130105 Thunderbird/10.0.12 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] References: <2bc90d3b-09c2-4315-9357-ff7f039465e0@googlegroups.com> <51bb454c$0$29997$c3e8da3$5496439d@news.astraweb.com> <51beb20c$0$29872$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371470335 news.xs4all.nl 15921 [2001:888:2000:d::a6]:50902 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48516 On 06/17/2013 05:34 AM, Simpleton wrote: > So is it safe to say that in Python a == &a ? (& stands for memory address) > > is the above correct? It might be partially equivalent inside the interpreter, but it's not something you should concern yourself with. And in general, no it's not safe to say, since Python is a reference-counted, garbage-collected object system and pointers in C certainly are not. > 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? 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. Forget about the details of how the interpreter might doing at a low level.