Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #106773

Re: REMOVE ME

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: REMOVE ME
Date Sun, 10 Apr 2016 13:52:07 +1000
Lines 19
Message-ID <mailman.2.1460260336.424.python-list@python.org> (permalink)
References <CALuqfDDNQ0N6xQXEKurzK1v0eVfU7jr6=-uvLT1zeGcf3vgexQ@mail.gmail.com> <CAPTjJmrdgBsSWUkNi+H8Tm8eqHA53pxVM-FP8ChqsxRNCeRNGA@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de enBVY+29gftR2f2Wff/a9A0YsH5LkR3fiRdu5pdV9xyg==
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.017
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'received:209.85.223': 0.03; 'cc:addr:python-list': 0.09; 'def': 0.13; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'presume': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'sure.': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'this:': 0.23; 'header:In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; 'guarantees': 0.29; 'objects': 0.29; "i'm": 0.30; 'url:mailman': 0.30; 'skip:_ 10': 0.32; 'class': 0.33; 'url:python': 0.33; 'url:listinfo': 0.34; 'received:google.com': 0.35; 'something': 0.35; 'list,': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'things': 0.38; 'itself': 0.38; 'received:209': 0.38; 'mean': 0.38; 'url:mail': 0.40; 'your': 0.60; 'chrisa': 0.84; 'to:none': 0.91; 'technique': 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=uAKtmuxRX3sGAP8KJG6CPiPIfxztnlqRn+qEYSjV8wg=; b=tROPWbizh0bxBKmLPqOCCPzTphohOVDl4AVsigSdBPiKKhKoNMJ40bH7vYjmUqMWmo 0nV6niiH1wwlWgqbE+/LNuFzItzgn3xmb8sxol1w464sVos5is0XnSu0iGFPwpdJ5fom AeAMqsIg+6MMtPgDr0NRJZ7ab1sC+wLQ+uZxeRuPnrRH5VI+QJjnfZZB31PQ6/gThZuM bjew9aQUIkzuw2ZDhls2hxaaPwA6OPN2c+dmWcCsvx3dCedb8dg2TerGfYjmrW9X5PX0 AX+cbjc9UnTF+7d9mcX/6mT0I83A3eXfnSvmV7s/jenO6HwSrhpNAtXhrjAivbEsxtCg pmSA==
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=uAKtmuxRX3sGAP8KJG6CPiPIfxztnlqRn+qEYSjV8wg=; b=U5m+iDE/zSkdFrCtBZ4P6+xMMQlLLoozVFoWdO+AGOVFV9hm58dOmwr7c1oR97HNAn 1NhB82F3ZCCh6PdkqXtE6RHCWt9Yqfe2TzPAHAJWeE51IYYYywL9wCIxYrVQyMugOKlg /mZkpaC090oRxbePjNRQBVtyyBX8Jor/ocdLi6XHwBmTe36j8EJheLitN74z+9bk/Nty Sb76lF86FHMZtfriByDvfYdHPln4EMGckKUdiyJoBbj7eQ8B2WGqP+FJTaI2TRGmpQEa 369KgHHIhsZoUGResdHq1QDaim1TDr/PerZoKxkuLNZ8wOv+uIrEh/NO00GIZO396wZo 78ng==
X-Gm-Message-State AD7BkJJp31Ch8drn5RWxQXtAt6ycf7r4x+F7ls/PDMFnuPBvSyUFeQtmGBJu7LfEK6lJJsH7q2jGR8JK82GvXg==
X-Received by 10.107.137.101 with SMTP id l98mr16707511iod.31.1460260327793; Sat, 09 Apr 2016 20:52:07 -0700 (PDT)
In-Reply-To <CALuqfDDNQ0N6xQXEKurzK1v0eVfU7jr6=-uvLT1zeGcf3vgexQ@mail.gmail.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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <CAPTjJmrdgBsSWUkNi+H8Tm8eqHA53pxVM-FP8ChqsxRNCeRNGA@mail.gmail.com>
X-Mailman-Original-References <CALuqfDDNQ0N6xQXEKurzK1v0eVfU7jr6=-uvLT1zeGcf3vgexQ@mail.gmail.com>
Xref csiph.com comp.lang.python:106773

Show key headers only | View raw


On Sun, Apr 10, 2016 at 1:46 PM, fan nie <niefan68@gmail.com> wrote:
>
> --
> https://mail.python.org/mailman/listinfo/python-list

Sure. I presume you mean something like this:

class Thing:
    things = []
    def __init__(self):
        self.things.append(self)
    def __del__(self):
        # Remove me when I'm dead
        self.things.remove(self)

This ingenious technique guarantees that you never have dead objects
in your list, by having each object remove itself when it dies.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: REMOVE ME Chris Angelico <rosuav@gmail.com> - 2016-04-10 13:52 +1000

csiph-web