Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python': 0.09; 'any.': 0.09; 'received:mail-lpp01m010-f46.google.com': 0.09; 'sep': 0.09; 'subject:set': 0.09; "wouldn't": 0.11; 'index': 0.13; 'cases': 0.15; 'iterators,': 0.16; 'justified': 0.16; 'overflow.': 0.16; 'wrote:': 0.17; 'idea': 0.24; 'testing': 0.24; 'header:In-Reply- To:1': 0.25; 'am,': 0.27; 'prevent': 0.27; 'message- id:@mail.gmail.com': 0.27; 'long.': 0.29; 'overhead': 0.29; 'reset': 0.29; 'received:209.85.215.46': 0.30; 'structure': 0.32; 'could': 0.32; 'int': 0.33; 'to:addr:python-list': 0.33; 'version': 0.34; 'received:google.com': 0.34; 'faster': 0.35; 'open': 0.35; 'doing': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'received:209': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'most': 0.61; 'exceed': 0.65; 'to:name:python': 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:content-transfer-encoding; bh=myGXFHoog37rm3J5ZA2sJGpuy956AsIaWUkwCquBtQA=; b=t0RUhv859fdtG9tWKLwcP/e+aO/yMrjkfHjOINx4SUYplYvjBMksM/aqq7rZDc7jk/ b9GzibrEidtp8x93UtCiVMvA4TXH6Nf6InNDYPU3BxzgB+FvgSB7L1y1S2zl1gKwbhGW CKlXe4mvEj3iahyJP0SEgoXlUoHsGKSAg3AOo6ZCxX22fKMceKkJDquYPHCzMixGrDiI xjmO/jbvFbJLGRFsM0GpGRuKzZhWEB9UeWy3vqNpsH0F8V9jElGa1g0QkFPHFYF6m1ld S7WpLtA9aBVe/rDKwJpwm7ElEcwflLDadPHJ2ISxwvXV/r3NB6z2hUqjtMC4M6nspyK/ aGMg== MIME-Version: 1.0 In-Reply-To: <1567e8c7-a2bb-41f4-9be8-18e9f4d063cb@googlegroups.com> References: <7xy5le7cli.fsf@ruckus.brouhaha.com> <502dab6c$0$29978$c3e8da3$5496439d@news.astraweb.com> <1567e8c7-a2bb-41f4-9be8-18e9f4d063cb@googlegroups.com> From: Ian Kelly Date: Mon, 3 Sep 2012 13:29:35 -0600 Subject: Re: set and dict iteration To: Python Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346700607 news.xs4all.nl 6969 [2001:888:2000:d::a6]:36089 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28366 On Sun, Sep 2, 2012 at 11:43 AM, Aaron Brady wrote: > We could use a Python long object for the version index to prevent overfl= ow. Combined with P. Rubin's idea to count the number of open iterators, m= ost use cases still wouldn't exceed a single word comparison; we could rese= t the counter when there weren't any. We could use a Python long; I just don't think the extra overhead is justified in a data structure that is already highly optimized for speed. Incrementing and testing a C int is *much* faster than doing the same with a Python long.