Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'interpreter': 0.04; 'subject:Python': 0.05; 'called.': 0.09; 'garbage': 0.09; 'references.': 0.09; 'cc:addr:python-list': 0.10; '__del__': 0.16; 'cyclic': 0.16; 'dummy': 0.16; 'run.': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'feb': 0.19; 'module': 0.19; 'putting': 0.20; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'necessary,': 0.29; 'probably': 0.29; 'class': 0.29; 'stuff': 0.30; 'gets': 0.32; 'that,': 0.34; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; "wasn't": 0.36; 'method': 0.36; 'quite': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'called': 0.39; 'different': 0.63; '2013': 0.84; 'trick,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=iEDVFsBnrp25GXyEd32vJqYP1RpeutqQz4jc7NM6YqI=; b=wTwQC792wKs2lYMo7CQqU27/IZvEhRwvkZLc8MS9tkvVJoOaDtY/pfY0KTRnwmxl2Q rpn+W4qJU9nN6sMp30/6WRbBYpXH3H7PlrtjURPZKZ18EOREmnV0GZAKZJI+dUUrbHLa xO9IdJqaqmzEd8ZZbz4+wGQdFv6jinkOkJhrzxXUGsKkK4b2UFSXTbAwVTE461ieXzjt sldXPW8zmjfc1DmHD2W1kn9sia5eUqYJ2SQOvk8iA+cORRFYpUlJ+xpFzSGK6L/2u+3n Nf3pwff9hhb3r9n7A3m/nynCK/rD0s/5hcITSBywVf3ISWJIQkTWYXRcVyK7EZlnZ93c RxEA== X-Received: by 10.220.208.137 with SMTP id gc9mr2774638vcb.51.1362072710673; Thu, 28 Feb 2013 09:31:50 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <512f8aa9$0$30001$c3e8da3$5496439d@news.astraweb.com> From: Devin Jeanpierre Date: Thu, 28 Feb 2013 12:31:10 -0500 Subject: Re: Speeding up Python's exit To: Chris Angelico Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362073181 news.xs4all.nl 6892 [2001:888:2000:d::a6]:40134 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40146 On Thu, Feb 28, 2013 at 12:06 PM, Chris Angelico wrote: > Is it any different if you create a deliberate reference loop and then > stuff it into some module somewhere? That would force it to be kept > until interpreter shutdown, and then a cyclic garbage collection after > that, which quite probably would be never run. A stupid trick, > perhaps, but it might work; I tested it with a dummy class with a > __del__ method and it wasn't called. Putting it into some other module > may not be necessary, but I don't know what happens with the > interactive interpreter and what gets freed up when. __del__ is never called for cyclic references. -- Devin