Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!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.035 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'wed,': 0.03; 'rewritten': 0.09; 'pm,': 0.10; 'wrote:': 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'recursive': 0.16; 'before.': 0.19; 'header:In-Reply-To:1': 0.21; 'received:209.85.210.174': 0.23; 'received:mail-iy0-f174.google.com': 0.23; 'message- id:@mail.gmail.com': 0.28; 'subject:How': 0.30; 'to:addr:python- list': 0.33; 'lines': 0.33; "i've": 0.33; 'received:google.com': 0.37; 'received:209.85': 0.37; 'two': 0.37; 'think': 0.38; 'subject:can': 0.38; 'but': 0.38; 'subject:: ': 0.38; 'subject: (': 0.39; 'received:209': 0.39; 'to:addr:python.org': 0.39; 'your': 0.60; 'as:': 0.71; 'generator,': 0.84; 'subject:over': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=4ktEh0Cso/QO5D+WyQqS6cjmKlA40JD42x0ONlVsR2g=; b=dAWPk2rKtR4ZasktIPQU9TR1IJevh1s/cXshcEUgyxIcukgniI9rpXz6QijDBvQ7VW ag6j340vHmo1xze0N1UEfQZy0ONNlVFuRo1y3k/ghyb1kibst/zoLK4B9jktF0qJrg0W kafj+bN9p+cNIFQi/u9pY44flkn1ADKjvlQFU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ID9AwJp0K7akwgVSgwrberZtyMxhNviGGA3y8YQHeaRJJb/y2QMWTSi0Zqy+0oj7Tj Hj0dI6EEyuPDJBB8T9TswBhCMled6ix+s8NA7CgvK7/coFyKoU6HONdSJ2rH8RPpUN+b mDHu3NykQRTXbOu0hjG4L1RYMlaQCVHWQ7TOo= MIME-Version: 1.0 In-Reply-To: <4e01d983$0$29977$c3e8da3$5496439d@news.astraweb.com> References: <4e01d983$0$29977$c3e8da3$5496439d@news.astraweb.com> Date: Wed, 22 Jun 2011 22:28:13 +1000 Subject: Re: How can I speed up a script that iterates over a large range (600 billion)? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 82.94.164.166 X-Trace: 1308745697 news.xs4all.nl 49184 [::ffff:82.94.164.166]:58244 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:8204 On Wed, Jun 22, 2011 at 10:01 PM, Anny Mous wrote: > =A0 =A0 =A0 =A0 =A0 =A0prime =3D table[i] > =A0 =A0 =A0 =A0 =A0 =A0del table[i] > I don't fully understand your algorithm, but I think these two lines can be rewritten as: prime=3Dtable.pop(i) Interesting algo. A recursive generator, not sure I've seen one of those be= fore. ChrisA