Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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; 'exit': 0.07; 'called.': 0.09; 'garbage': 0.09; 'references.': 0.09; '__del__': 0.16; 'cyclic': 0.16; 'dummy': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'run.': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'feb': 0.19; 'module': 0.19; 'putting': 0.20; 'header:In-Reply- To:1': 0.25; 'am,': 0.27; 'then.': 0.27; 'message- id:@mail.gmail.com': 0.27; 'chris': 0.28; 'detector': 0.29; 'necessary,': 0.29; 'probably': 0.29; 'class': 0.29; 'fri,': 0.30; 'stuff': 0.30; 'gets': 0.32; 'to:addr:python-list': 0.33; 'that,': 0.34; 'received:google.com': 0.34; 'pm,': 0.35; "won't": 0.35; 'received:209.85': 0.35; 'but': 0.36; 'modules': 0.36; "wasn't": 0.36; 'method': 0.36; 'test': 0.36; 'quite': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; '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=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=2RiVZ9t3AnhuhzqdWSLbjkEI0X/po5PlYwAvVh9Gafc=; b=zgVGsdlnOORa+gO0dLMzHeTUH7C0dNqnzdmimUMHq32zwuvLoaeLhDMh4oB15yJDcr sDhcmY9rs7Y/hTinGzslpgHNu1gs//KDAyCT2vRquvXPJEDS5Wz+JQo8CYc5YORHveU/ s5r7lMQQRLnjIx/dZCVFuqUJe9lsQRk23+53N2VJbM6c4MR1X750Ihh1jQUuNkt8mm46 vpAyl2rN1hjqjD7iaScRln/cUt86feU1AE6xuMXMr6E8hJSq7ld42GjH7ExYzvVS5SpI S5HKQHEGgjFSOfAglDP62+gO94aqyaRHoc6FSEmiiBG1aK3rwcsQ7ec7NuxgruS3N86Z BWSA== MIME-Version: 1.0 X-Received: by 10.52.29.209 with SMTP id m17mr2470690vdh.111.1362072824469; Thu, 28 Feb 2013 09:33:44 -0800 (PST) In-Reply-To: References: <512f8aa9$0$30001$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 1 Mar 2013 04:33:44 +1100 Subject: Re: Speeding up Python's exit From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362072826 news.xs4all.nl 6905 [2001:888:2000:d::a6]:60912 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40144 On Fri, Mar 1, 2013 at 4:31 AM, Devin Jeanpierre wrote: > 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. D'oh. Test is flawed, then. But is the theory plausible? That the cycle detector won't be called on exit after other modules get freed? ChrisA