Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.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.138 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.72; '*S*': 0.00; '4:35': 0.16; 'called,': 0.16; 'elements': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'header:In- Reply-To:1': 0.27; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; '>>>>': 0.31; 'guess': 0.33; 'could': 0.34; 'knows': 0.35; 'done.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'are,': 0.36; 'false': 0.36; 'done': 0.36; 'subject:?': 0.36; 'ahead': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'pm,': 0.38; '12,': 0.39; 'itself': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'ian': 0.60; 'mar': 0.68; 'subject:skip:g 10': 0.84 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 :content-type; bh=J8BjphVrVHV+WQH0/tQ7p+iv1bJ4SiWq5ah7EEjB7Is=; b=gcxwZknaMcZpCZEY5wOj7OzitEJ/a5OLmP31A34z5rKRoL8T+ht+yuD1m93gerfi2L wcGW6ssIZU+OahYdud7Zu5zf+N+B+9g2lkCwneqowIcc2FQJZf0njsO0ZsoYI8ZJJNl2 tp9nwfhnFvODKugldXB73LwVEohIc7meqc4jAVRklrvOrWIY8tXUXIEcc7NalaieohC4 cmDvomY17eXkK/ntdzDHRUDvIy/0yWgmT18+V+xZMcqFtJdvnAzpgY6UniFiBVCriTni QW71YkcPkcK8O02eYTP73FN12TMXderg/oVR+NNxk/6DTArOzbqLqJ+Snc9JXgvMGnvG Ahvg== X-Received: by 10.66.171.76 with SMTP id as12mr177575pac.52.1394664043239; Wed, 12 Mar 2014 15:40:43 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <5320BD3F.5030509@mrabarnett.plus.com> From: Ian Kelly Date: Wed, 12 Mar 2014 16:40:00 -0600 Subject: Re: What does gc.get_objects() return? To: Python 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: 1394664046 news.xs4all.nl 2893 [2001:888:2000:d::a6]:38052 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68303 On Wed, Mar 12, 2014 at 4:35 PM, Ian Kelly wrote: >> So not all optimizations are done that could be done. > > Or is it? > >>>> a = 1,2,3 >>>> gc.is_tracked(a) > True >>>> gc.collect() > 0 >>>> gc.is_tracked(a) > False I guess the reason for this is that when PyTuple_New is called, it knows how many elements it will contain but doesn't know yet what they are, so it defers the issue by just going ahead and adding itself to the GC