Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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; '16,': 0.03; 'broken': 0.04; 'charset:iso-8859-7': 0.04; 'value,': 0.04; 'variables': 0.07; 'if,': 0.09; 'latter': 0.09; 'variables.': 0.09; 'cc:addr :python-list': 0.11; 'suggest': 0.14; '"b"': 0.16; 'bind': 0.16; 'command.': 0.16; 'objects.': 0.16; 'respondents': 0.16; 'run:': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'memory': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'correct': 0.29; 'michael': 0.29; 'message- id:@mail.gmail.com': 0.30; '>>>>': 0.31; 'changed.': 0.31; 'names.': 0.31; 'addresses': 0.33; 'test': 0.35; 'received:google.com': 0.35; 'false': 0.36; 'two': 0.37; 'fact': 0.38; 'pm,': 0.38; 'changed': 0.39; 'above,': 0.60; 'address': 0.63; 'act': 0.63; 'different': 0.65; 'yourself': 0.78; 'restrain': 0.84; 'subject:gets': 0.84; 'to:addr:support': 0.84; '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:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=Y35IJy4vP7JykEmhcXp9GGAPLep/wjzC7rYUkwE0f3k=; b=R1erwcycKQ8ZiyEb9OCD0QSxDILf3Vl6sKbytOoRLWzH+GKyli95+4ZGI4kj1iWp/7 NZ61yEclHI93ZJfNI2ksdLs1dyXLihS5+aYUgKsHkcJP8xqGOtVlefTRSFf/Ey6I3vVM AotTb5cqPxNzXJAjg4WnOS0antZURr2hL6d/eu6k4igiqpMLyPU09Q3VY1AXZDtrumA8 I9HNPAvXxkKmtFOIINlvMJfRF405WflsmahhdpJXaRd2jF4PLrJn8P+aFtljghm95ivD DXlKkbWm1iEvY1/AJR1Jnpq4IBxIOz4ARK0E9fB6dc89CDWRpFm03ipKnG1+lDCjTX/A UrGQ== X-Received: by 10.152.88.42 with SMTP id bd10mr5192604lab.32.1371408856398; Sun, 16 Jun 2013 11:54:16 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <2bc90d3b-09c2-4315-9357-ff7f039465e0@googlegroups.com> <51b926a3$0$29997$c3e8da3$5496439d@news.astraweb.com> <51ba6e92$0$29997$c3e8da3$5496439d@news.astraweb.com> <51bb454c$0$29997$c3e8da3$5496439d@news.astraweb.com> From: "R. Michael Weylandt" Date: Sun, 16 Jun 2013 19:53:56 +0100 Subject: Re: A certainl part of an if() structure never gets executed. To: Ferrous Cranus Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable Cc: python-list 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: 44 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371408858 news.xs4all.nl 15986 [2001:888:2000:d::a6]:54941 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48467 On Sun, Jun 16, 2013 at 2:47 PM, Ferrous Cranus wrot= e: > On 16/6/2013 2:13 =EC=EC, Jussi Piitulainen wrote: >> >> If, instead of the above, you have >> >> a =3D 6 >> b =3D a >> b =3D 5 >> >> you will find that b =3D=3D 5 and a =3D=3D 6. So b is not the same as a.= Else >> one would have changed when the other changed. I would say that a and >> b are different variables. They had the same value, briefly. > > > If they were different variables then they would have different memory > addresses and they would act like two different objects. > > But... both a and b are for a fact mappings for the same memory address a= s > seen form the following command. > >>>> id(a) =3D=3D id(b) > True > > They are like the same object with 2 different names. This will depend on when the test is run: a =3D 6 b =3D a a is b # True b =3D 5 a is b # False The latter is false because the binding of "b" to the int 6 was broken in order to bind b to the int 5. I might also suggest you restrain from trying to correct respondents on these matters until you yourself understand them. It's only polite. Michael