Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: REMOVE ME Date: Tue, 12 Apr 2016 10:44:59 +1000 Lines: 14 Message-ID: References: <570C28C9.3090103@o2.co.uk> <570c2f00$0$1608$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de EmOkyZnRNqP8csQxcTTNLQcJ/B7W07IIUT33+FzxkEoQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'received:209.85.223': 0.03; 'cc:addr:python-list': 0.09; 'happen.': 0.09; '2016': 0.16; '__del__': 0.16; 'attribute,': 0.16; 'called,': 0.16; 'exception;': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'assign': 0.22; 'am,': 0.23; 'defined': 0.23; 'references': 0.23; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'example': 0.26; 'message-id:@mail.gmail.com': 0.27; 'raise': 0.29; 'regardless': 0.31; "can't": 0.32; 'class': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'tue,': 0.34; 'list': 0.34; 'gets': 0.35; 'received:google.com': 0.35; 'instance': 0.35; 'but': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'method': 0.37; '12,': 0.37; 'received:209': 0.38; 'does': 0.39; 'more...': 0.66; 'guaranteed': 0.67; 'chrisa': 0.84; 'to:none': 0.91; 'anywhere,': 0.93 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:cc; bh=6aUjxnTseFIyOE8Iw/3p2RoB3sX4iPgBW4+j4AJuDzU=; b=AnSy0U5HSYnmkOgTG2A6DIu3OwYdIUi+2h984b2nH2BQx1hgdztoGj9JeZA6bl/alD D3qiCd9Kz/mDWSc/dymhVVv7cJSPqkAUp+xgd1p+fD6CyGNt8RCaQAHDMGjZeqGN+fUV B1wuypfg0mY/DlnN75b+3Hm+u06MhuYJbMBlvsWoYqi75VPNYq4YQIwCPYexvpwAJFYu /fiPoxU49j8r4D7PNLesxP/3CSrX203jkpuOTevDm4ljF1FnrbxtbfjIz2/DuwdslSFf O+KCT3DwFJJUrO4FPvkPKt2hOWb23YtXqW6rjDBoLoROP2oV30PRUuYHhaj3YyQiw/zs h5yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=6aUjxnTseFIyOE8Iw/3p2RoB3sX4iPgBW4+j4AJuDzU=; b=XiHJsDRXl5wD/v56oLu/GPbckSlFnDPaeHAlXeUD2Tf4Wup320gDa4jMV+8BLDZOwN 1ufaJZ2FSHvURA3I5ScOzjOP5/bYV7t2agYXTYHmi4ZkTHpNY6zVj2WupAj6Whr/AORE Dzoy5gBSwXclhFYwkSvBJHyTzPjNRz7kp3ZwXU9XUO/0aFjgGBckmX9J5/DbMf+IVWzo fmUNnnBnIHeevDx1mMszLNxAWC+lNdr36qv3o7NGOnXI+wQaitAotd5xon5tenslXo90 Xp4vrO9ls+Ewze9khdrnC54+zVfFjmpZ99ASfGnTS0UEx3xKZ7SUojWBaI4EBARRKDcL Pg1g== X-Gm-Message-State: AOPr4FW8u5zSfzfKYf39OJXJWS1IsotsW5xm82vn8A/OTqGNm13OTtvxKaWRvqkjKd4E7NxtIn6h/CZGzuR7dg== X-Received: by 10.107.137.101 with SMTP id l98mr873608iod.31.1460421899879; Mon, 11 Apr 2016 17:44:59 -0700 (PDT) In-Reply-To: <570c2f00$0$1608$c3e8da3$5496439d@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <570C28C9.3090103@o2.co.uk> <570c2f00$0$1608$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:106897 On Tue, Apr 12, 2016 at 9:10 AM, Steven D'Aprano wrote: > Hence "self.things" will return the same > list each time, the one defined as a class attribute, regardless of > which "self" does the lookup. > > If a method were to assign to the attribute, for example "self.things = []", > that would create an instance attribute, but that doesn't happen. Indeed. And the __del__ method is guaranteed always to raise an exception; by the time __del__ gets called, there can't be any references to the object anywhere, so it can't be in that list any more... ChrisA