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


Groups > comp.lang.python > #50476

Re: xslice idea | a generator slice

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 <ian.g.kelly@gmail.com>
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 <CAA=1kxR_XPqgA7-_m-WmiZNjczN4-uTNqTPHEzxROCnxMhfGGQ@mail.gmail.com>
References <4a81b6a6-023e-4d47-9bd0-bbc0516caf6b@googlegroups.com> <c087829a-8e30-4f50-afb9-d28a779932e3@googlegroups.com> <mailman.4590.1373555714.3114.python-list@python.org> <56736add-f372-4245-9f50-076b3d44bb00@googlegroups.com> <CAHVvXxSDQwk1KVLETetOz5EiNK3BjTD=6px_L9SFfcpfbhuYzA@mail.gmail.com> <CAA=1kxR_XPqgA7-_m-WmiZNjczN4-uTNqTPHEzxROCnxMhfGGQ@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Thu, 11 Jul 2013 15:02:39 -0600
Subject Re: xslice idea | a generator slice
To Python <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.15
Precedence list
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.4602.1373576607.3114.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Thu, Jul 11, 2013 at 1:58 PM, Fábio Santos <fabiosantosart@gmail.com> wrote:
> Isn't all of itertools implemented in C? If we are not using a python-level
> 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 would
> be tiny?

Oscar's version which is an imap of an xrange is also effectively
implemented in C.  Only the setup is in Python.

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


Thread

xslice idea | a generator slice Russel Walker <russ.pobox@gmail.com> - 2013-07-11 07:52 -0700
  Re: xslice idea | a generator slice Russel Walker <russ.pobox@gmail.com> - 2013-07-11 07:54 -0700
    Re: xslice idea | a generator slice Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-07-11 16:14 +0100
      Re: xslice idea | a generator slice Russel Walker <russ.pobox@gmail.com> - 2013-07-11 09:21 -0700
        Re: xslice idea | a generator slice Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-07-11 17:34 +0100
        Re: xslice idea | a generator slice Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-11 12:00 -0600
        Re: xslice idea | a generator slice Fábio Santos <fabiosantosart@gmail.com> - 2013-07-11 20:58 +0100
        Re: xslice idea | a generator slice Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-11 15:02 -0600
  Re: xslice idea | a generator slice Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-11 10:16 -0600

csiph-web