Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!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.041 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.01; 'python.': 0.02; 'assume': 0.14; 'itertools': 0.16; 'looping': 0.16; 'python-level': 0.16; 'subject:generator': 0.16; 'xrange': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'input': 0.22; 'memory': 0.22; 'header:In-Reply-To:1': 0.27; 'thus': 0.29; 'message-id:@mail.gmail.com': 0.30; 'implemented': 0.33; 'could': 0.34; 'received:google.com': 0.35; 'version': 0.36; 'too': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'effectively': 0.66; 'jul': 0.74; 'increase': 0.74; 'faster.': 0.84; '2013': 0.98 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=F0Wff2V4e2yelkvKDl8s/VuHej7EjfpCeKlMZ7atKHE=; b=Zlrm+9a4/zURnSLLhHqGTEgarr94Fighguilb4E4o6O6T/JVcpWZfF1V5z8eDbnmol tgoei0wi57adqvBcIRF2YfyoDM1JZw6RpjJOD5iLPIWYezoIDfD1xcubBX24LlBxnP84 SBMSKSZoYcPuIjEl4BEDdFgrcLnEzE79ctQyl8fjpeJYr0f0EAmMMVgJoJ9TdRV+JbyQ DLbm9ZmRV3qEbll73J0cFscdwLPijPlvw6XN5MF1wq0LVEkvsfUNad3jHMcD0Ndmqe6o cGFWrcLzhONjLlhmG+jrBaGvBT5M32HpNg3ZTrmg21opuq2mTbG3dztYRC0GwSgZBtie Y7Jg== X-Received: by 10.66.141.71 with SMTP id rm7mr40423981pab.90.1373576599605; Thu, 11 Jul 2013 14:03:19 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <4a81b6a6-023e-4d47-9bd0-bbc0516caf6b@googlegroups.com> <56736add-f372-4245-9f50-076b3d44bb00@googlegroups.com> From: Ian Kelly Date: Thu, 11 Jul 2013 15:02:39 -0600 Subject: Re: xslice idea | a generator slice 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1373576608 news.xs4all.nl 15968 [2001:888:2000:d::a6]:56862 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50476 On Thu, Jul 11, 2013 at 1:58 PM, F=E1bio Santos = wrote: > Isn't all of itertools implemented in C? If we are not using a python-lev= el > and not-so-fast __getitem__ I would wager the C version is a lot faster. > > And if the input is indexable could I assume that it is not too large to > have around in memory and thus any speed increase in looping over it woul= d > be tiny? Oscar's version which is an imap of an xrange is also effectively implemented in C. Only the setup is in Python.