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


Groups > comp.lang.python > #44580

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 <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'subject:not': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'sized': 0.07; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Why': 0.09; '3],': 0.16; 'chunks': 0.16; 'iterator': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'url:312443': 0.16; 'url:djangoproject': 0.16; 'url:how-do- you-split-a-list-into-evenly-sized-chunks-in-python': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'split': 0.19; 'python?': 0.22; 'header:User-Agent:1': 0.23; 'url:moin': 0.24; 'post': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'url:code': 0.29; "doesn't": 0.30; 'asked': 0.31; 'url:wiki': 0.31; 'url:python': 0.33; 'subject:the': 0.34; 'subject:?': 0.36; 'url:org': 0.36; 'should': 0.36; 'list': 0.37; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'read': 0.60; "you're": 0.61; 'kind': 0.63; 'charset:windows-1252': 0.65; 'behavior': 0.77; 'received:2': 0.84; 'url:ticket': 0.84; 'mistakes': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Why chunks is not part of the python standard lib?
Date Wed, 01 May 2013 08:10:11 +0100
References <CAP5i+tYC+cMtseEduTm76LXkaP1Hh-Tz-_HipO7LsURtnuwtOw@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host host-2-98-196-142.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130328 Thunderbird/17.0.5
In-Reply-To <CAP5i+tYC+cMtseEduTm76LXkaP1Hh-Tz-_HipO7LsURtnuwtOw@mail.gmail.com>
X-Antivirus avast! (VPS 130430-1, 01/05/2013), Outbound message
X-Antivirus-Status Clean
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.1208.1367392233.3114.python-list@python.org> (permalink)
Lines 33
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367392233 news.xs4all.nl 15929 [2001:888:2000:d::a6]:59708
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44580

Show key headers only | View raw


On 01/05/2013 07:26, Ricardo Azpeitia Pimentel wrote:
> After reading How do you split a list into evenly sized chunks in
> Python?
> <http://stackoverflow.com/questions/312443/how-do-you-split-a-list-into-evenly-sized-chunks-in-python>
> and seeing this kind of mistakes happening
> https://code.djangoproject.com/ticket/18972 all the time.
>
> Why is not a |chunks| function in itertools?
>
> |grouper| from
> http://docs.python.org/2/library/itertools.html#recipes doesn't have the
> same behavior as |chunks |
>
> Example:
> |
>
> |chunks([1,  2,  3,  4,  5],  3)
> # Should return [[1, 2, 3], [4, 5]] or the iterator equivalent.|
>
> |Original Post on StackOverflow:
> http://stackoverflow.com/questions/16313008/why-chunks-is-not-part-of-the-python-standard-lib
>
>

Asked and answered a trillion times.  There's no concensus on how chucks 
should behave.

-- 
If you're using GoogleCrap™ please read this 
http://wiki.python.org/moin/GoogleGroupsPython.

Mark Lawrence

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


Thread

Re: Why chunks is not part of the python standard lib? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-01 08:10 +0100

csiph-web