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


Groups > comp.lang.python > #28746

Re: set and dict iteration

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.020
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'function,': 0.07; 'list?': 0.07; 'objects,': 0.07; "'''": 0.09; 'immutable': 0.09; 'objects.': 0.09; 'subject:set': 0.09; 'terms,': 0.09; 'tuple': 0.09; 'above?': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'immutable,': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'references': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'consisting': 0.29; 'detector': 0.29; 'received:192.168.1.3': 0.29; 'lists': 0.31; 'implement': 0.32; 'to:addr:python-list': 0.33; 'another': 0.33; 'or,': 0.34; 'list': 0.35; 'apply.': 0.35; 'add': 0.36; 'created': 0.36; 'but': 0.36; 'turn': 0.36; 'possible': 0.37; 'does': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'help': 0.40; 'thomas': 0.62; 'more': 0.63; 'note:': 0.64; 'charset:windows-1252': 0.65; 'therefore': 0.65; 'header:Reply-To:1': 0.68; 'direct': 0.69; 'reply-to:no real name:2**0': 0.72; 'indirect': 0.84; 'it\x92s': 0.84; 'rachel': 0.84; 'reply-to:addr:python.org': 0.84; 'was:': 0.91
X-CM-Score 0.00
X-CNFS-Analysis v=2.0 cv=W6e6pGqk c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=lR6CHUT36vYA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=N659UExz7-8A:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=Ns7uWrT23YMA:10 a=TKwEb9KKHyJ1hMt-60oA:9 a=pILNOxqGKmIA:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117
X-AUTH mrabarnett:2500
Date Sat, 08 Sep 2012 22:22:55 +0100
From MRAB <python@mrabarnett.plus.com>
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120824 Thunderbird/15.0
MIME-Version 1.0
To python-list@python.org
Subject Re: set and dict iteration
References <b8dd3aca-2a87-4124-ad6e-66a8720af99a@googlegroups.com> <mailman.3389.1345146609.4697.python-list@python.org> <7xy5le7cli.fsf@ruckus.brouhaha.com> <mailman.3404.1345158704.4697.python-list@python.org> <502dab6c$0$29978$c3e8da3$5496439d@news.astraweb.com> <fe95c29c-2289-4e9c-870e-e3c475f13459@googlegroups.com> <mailman.3435.1345240665.4697.python-list@python.org> <d4708687-2925-421a-b755-969d6dac731a@googlegroups.com> <mailman.3476.1345328046.4697.python-list@python.org> <k2g8fg$fop$1@r03.glglgl.gl>
In-Reply-To <k2g8fg$fop$1@r03.glglgl.gl>
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To python-list@python.org
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.392.1347139563.27098.python-list@python.org> (permalink)
Lines 36
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1347139563 news.xs4all.nl 6921 [2001:888:2000:d::a6]:46763
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:28746

Show key headers only | View raw


On 08/09/2012 21:06, Thomas Rachel wrote:
> Am 19.08.2012 00:14 schrieb MRAB:
>
>>> Can someone who is more familiar with the cycle detector and cycle
>>> breaker, help prove or disprove the above?
>>>
>> In simple terms, when you create an immutable object it can contain
>> only references to pre-existing objects, but in order to create a cycle
>> you need to make an object refer to another which is created later, so
>> it's not possible to create a cycle out of immutable objects.
>
> Yes, but if I add a list in-between, I can create a refcycle:
>
> a = []
> b = (a,)
> a.append(b)
>
> So b is a tuple consisting of one list which in turn contains b.
>
> It is not a direct cycle, but an indirect one.
>
> Or would that be detected via the list?
>
The quote was:

'''
...The tuple type does not implement a tp_clear function, because it’s 
possible to prove that no reference cycle can be composed entirely of 
tuples.
'''

Note: "composed entirely of tuples".

Or, in general, composed entirely of immutables.

Lists are not immutable, therefore the proof does not apply.

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


Thread

Re: set and dict iteration Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-09-08 22:06 +0200
  Re: set and dict iteration Hans Mulder <hansmu@xs4all.nl> - 2012-09-08 23:18 +0200
  Re: set and dict iteration MRAB <python@mrabarnett.plus.com> - 2012-09-08 22:22 +0100

csiph-web