Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.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.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; '16,': 0.03; 'charset:iso-8859-7': 0.04; 'value,': 0.04; 'referring': 0.07; 'happens.': 0.09; 'referenced': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '"a"': 0.16; '"b"': 0.16; '"should"': 0.16; 'before.': 0.16; 'does,': 0.16; 'function?': 0.16; 'implies': 0.16; 'interchange.': 0.16; 'mechanism.': 0.16; 'normative': 0.16; 'storing': 0.16; 'wrote:': 0.18; "python's": 0.19; 'seems': 0.21; '>>>': 0.22; 'memory': 0.22; 'cc:addr:python.org': 0.22; 'exists': 0.24; 'tells': 0.24; 'cc:2**0': 0.24; 'sort': 0.25; 'header:In- Reply-To:1': 0.27; 'idea': 0.28; 'point': 0.28; 'function': 0.29; 'michael': 0.29; 'received:209.85.217': 0.29; 'words': 0.29; 'locations': 0.30; 'returned': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'getting': 0.31; 'continues': 0.31; 'depth': 0.31; 'object.': 0.31; 'not.': 0.33; "can't": 0.35; 'received:209.85': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'false': 0.36; 'should': 0.36; 'received:209': 0.37; 'pm,': 0.38; 'that,': 0.38; 'does': 0.39; 'heard': 0.39; 'itself': 0.39; 'either': 0.39; 'even': 0.60; 'remove': 0.60; 'gone': 0.61; 'matter': 0.61; 'simply': 0.61; 'first': 0.61; "you've": 0.63; 'address': 0.63; 'name': 0.63; 'different': 0.65; 'prompt': 0.68; 'fact,': 0.69; 'fact.': 0.84; 'premise': 0.84; 'subject:gets': 0.84; 'to:addr:support': 0.84; 'involved.': 0.91; 'imagine': 0.93; 'directly.': 0.95; '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=v8Ri0ToxqqmcppZcBHxQSs17pN8VhLEDHWLeqN2xXKs=; b=Kuw9zGDT2ow5upAep09dbmpUnr7MPbxQrWtU4Uhh4yGRX2kRy6o4Gmuadt/FbTtPRv +WT7oHy60adQdgc4VbDAT3j9IdcZJRUTzmmHB4hG9aAynhZtXmGU4xRdDvJjS+beThzM A96oo4wEC/2FACjRyafyo8jIdofrdG6+YFGhT5C9LWkKpiSwiI4tvg7E4Qoz4VRMW7C8 s8W6NTkRAdosLj/7ObJke7o3cxj0NtKgPk4CEJCUARDvjHsfgB9mLuzoBLI0jnMMzRfY 8HXbsQLTfvWMmAC2i39/j1BabTu5zq2f3ZMsA5xTG9mhNTVvEFFAOVC//4ZUvykyk40S DmRw== X-Received: by 10.152.88.5 with SMTP id bc5mr4669680lab.81.1371384293977; Sun, 16 Jun 2013 05:04:53 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <2bc90d3b-09c2-4315-9357-ff7f039465e0@googlegroups.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 13:04:33 +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: 79 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371384296 news.xs4all.nl 15876 [2001:888:2000:d::a6]:42546 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48443 On Sun, Jun 16, 2013 at 12:06 PM, Ferrous Cranus wro= te: I appreciate you've returned to your Ferrous Cranus persona for this interchange. It reminds me not to get hung up on concerns of futility... > On 16/6/2013 1:42 =EC=EC, R. Michael Weylandt wrote: >>> >> >> ## CODE SNIPPET## >> a =3D 552315251254 >> b =3D a >> c =3D 552315251254 >> >> a is b # True _on my machine_ > > > I accept this if in the premise that, b boils down to actually point to a= 's > value, but it has to go through a first to find it, not directly. You don't get to "accept it on a premise" or not. It's simply a matter of f= act. In fact, b does not go "through" a. The memory address referenced exists even if the "a" binding is removed using "del a" or some other mechanism. Imagine this scenario: [a] \ 6 / [b] Using the name "a" or "b" simply tells Python where to look for a value, but the value itself is not associated with "a" or "b" and will only be removed if both a and b are del'd. If we remove "a" while keeping "b" alive, we still have a means of getting to "6" so Python's GC / RefCounter won't remove it. This implies that the memory can't be solely "owned" by "a". [a] # Binding gone now or perhaps referring to something else 6 / [b] And this pattern continues for any sort of Python object. > >> a is c # False _on my machine_ > > > Why false? These are 2 different memory locations storing the same numbe= r. > This should have been True. Again, you have the idea that you can use words like "should" here. It either is or isn't. There's simply no normative claim involved. > > what id() does, never heard of that function before. > It seems you've also never heard of Python's "help" function? Try help(id) at your interactive prompt and see what happens. > > -- > What is now proved was at first only imagined! Depth of stubbornness?