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


Groups > comp.lang.python > #44623

Re: Why chunks is not part of the python standard lib?

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <oscar.j.benjamin@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.023
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'subject:not': 0.03; 'builtin': 0.09; 'subject:Why': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'mostly': 0.14; '(actually': 0.16; 'benjamin': 0.16; 'itertools': 0.16; 'url:file': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'module': 0.19; 'thu,': 0.19; 'written': 0.21; 'cc:addr:python.org': 0.22; "aren't": 0.24; 'documented': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'equivalent': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'chris': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'usually': 0.31; 'probably': 0.32; 'url:python': 0.33; 'subject:the': 0.34; "i'd": 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'version': 0.36; 'combination': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'list': 0.37; 'pm,': 0.38; 'easy': 0.60; 'most': 0.60; 'more': 0.64; 'to:addr:gmail.com': 0.65; 'here': 0.66; 'covers': 0.68; 'describes': 0.84; 'oscar': 0.84; 'understand,': 0.84; 'url:cpython': 0.84; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=UClx/9pd00Hybn+XaDhsEBVQDkDpbyJwuhbTJaJLgSQ=; b=pKY9L6l8wel9pes3b6RTO/BrshxqAeHOXslvhi7cXGdQ+dac5JbYrTSe/ODo+GDAUD SLeZO4yPQFc3DwVkz/6hjG5Xd+kw7bZaLR3lWHyTWHiYlgvduilx6exTtI2MyeDxrY+f 1g00dqhODBZPx8Lqx8VjQs1H/RBS/Vh4VsQuRQAhi24eIaXOHS2AMR2RmCsCXgci+Yef OG5a5FG6Mck0aGR9x2lAZVkkR3BtHQNB+skhe/qkl+a++bGN8PxuQWX08IHcxb4i3rb0 TBEzDucqON2A7t9zt4ExKTfrJemFqrlC/W7cYrji2DuQ72Xz5IaYMhFyGKjNgTk17T52 aRkw==
X-Received by 10.58.220.129 with SMTP id pw1mr2147047vec.32.1367501057344; Thu, 02 May 2013 06:24:17 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <CAPTjJmqv8q3Xe=eFUfd+O4nhSEFg6pMJErwG9q6rM1qEyOuJ2A@mail.gmail.com>
References <CAP5i+tYC+cMtseEduTm76LXkaP1Hh-Tz-_HipO7LsURtnuwtOw@mail.gmail.com> <klqf4g$ekd$1@ger.gmane.org> <mailman.1213.1367398827.3114.python-list@python.org> <5181f679$0$29882$c3e8da3$5496439d@news.astraweb.com> <CAHVvXxQQXLvSSMCp=WEEUpc-RjULQinfxAJn=Gqzg2HP7=t=3g@mail.gmail.com> <CAPTjJmqv8q3Xe=eFUfd+O4nhSEFg6pMJErwG9q6rM1qEyOuJ2A@mail.gmail.com>
From Oscar Benjamin <oscar.j.benjamin@gmail.com>
Date Thu, 2 May 2013 14:23:57 +0100
Subject Re: Why chunks is not part of the python standard lib?
To Chris Angelico <rosuav@gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Cc python-list@python.org
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.1235.1367501060.3114.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367501060 news.xs4all.nl 16012 [2001:888:2000:d::a6]:60378
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44623

Show key headers only | View raw


On 2 May 2013 13:55, Chris Angelico <rosuav@gmail.com> wrote:
> On Thu, May 2, 2013 at 10:52 PM, Oscar Benjamin
> <oscar.j.benjamin@gmail.com> wrote:
>> They are all easy to write as generator functions but to me the point
>> of itertools is that you can do things more efficiently than a
>> generator function. Otherwise code that uses a combination of
>> itertools primitives is usually harder to understand than an
>> equivalent generator function so I'd probably avoid using itertools.
>
> Aren't most of the itertools primitives written in Python anyway? If
> your code is harder to understand, just write the generator function!

The documentation describes them by showing equivalent generator
functions and there may be a pure Python version of the module but if
you look here then you can see which are builtin for CPython:

http://hg.python.org/cpython/file/c3656dca65e7/Modules/itertoolsmodule.c#l4070

The list covers all of the documented itertools functions (actually I
now realise that they're mostly types not functions).


Oscar

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


Thread

Re: Why chunks is not part of the python standard lib? Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-05-01 10:00 +0100
  Re: Why chunks is not part of the python standard lib? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-02 05:15 +0000
    Re: Why chunks is not part of the python standard lib? Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2013-05-02 08:53 +0000
    Re: Why chunks is not part of the python standard lib? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-02 10:23 +0100
    Re: Why chunks is not part of the python standard lib? Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-05-02 13:52 +0100
    Re: Why chunks is not part of the python standard lib? Chris Angelico <rosuav@gmail.com> - 2013-05-02 22:55 +1000
    Re: Why chunks is not part of the python standard lib? Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-05-02 14:23 +0100
    Re: Why chunks is not part of the python standard lib? Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2013-05-02 14:02 +0000

csiph-web