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


Groups > comp.lang.python > #7036

Re: How does this work?

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!news2.google.com!news.glorb.com!news.astraweb.com!border6.newsrouter.astraweb.com!not-for-mail
From Ben Finney <ben+python@benfinney.id.au>
Newsgroups comp.lang.python
Subject Re: How does this work?
References <mailman.2463.1307239834.9059.python-list@python.org> <878vth3q3z.fsf@benfinney.id.au> <90d0139d-a328-48e2-82f0-766458598f09@j23g2000yqc.googlegroups.com>
X-Public-Key-ID 0xAC128405
X-Public-Key-Fingerprint 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405
X-Public-Key-URL http://www.benfinney.id.au/contact/bfinney-pubkey.asc
X-Post-From Ben Finney <bignose+hates-spam@benfinney.id.au>
Date Sun, 05 Jun 2011 16:49:51 +1000
Message-ID <874o444vsg.fsf@benfinney.id.au> (permalink)
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)
Cancel-Lock sha1:SevlyDwDT29DFC4AW9eVkgkwl6g=
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
Lines 28
Organization Unlimited download news at news.astraweb.com
NNTP-Posting-Host 06c955c7.news.astraweb.com
X-Trace DXC=6b[PFOXS7E=SG6fD[7G;H=L?0kYOcDh@:N7:H2`MmAU3JoZ66_70GP6]G;2>V^?kW3bEW9A[5UK?5NZ[SL`C\Kg3lNTOcY[[o5>
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:7036

Show key headers only | View raw


Jon Clements <joncle@googlemail.com> writes:

> On Jun 5, 4:37 am, Ben Finney <ben+pyt...@benfinney.id.au> wrote:
> > <jyoun...@kc.rr.com> writes:
> > > (http://stackoverflow.com/questions/312443/how-do-you-split-a-list-int...)
> >
> > This is an excellent example of why “clever” code is to be shunned.
> > Whoever wrote this needs to spend more time trying to get their code
> > past a peer review; the above would be rejected until it was
> > re-written to be clear.
> >
> > Here is my attempt to write the above to be clear (and fixing a couple
> > of bugs too):

> Just my 2p, but isn't the itertools "grouper" recipe prudent?

Oh, if we go looking for ways to improve what that code is doing, there
are many things wrong with it, not least that it is re-implementing code
that already exists in the standard library.

But I'll leave that to the several superior answers at the Stackoverflow
question.

-- 
 \       “Pray, v. To ask that the laws of the universe be annulled in |
  `\     behalf of a single petitioner confessedly unworthy.” —Ambrose |
_o__)                           Bierce, _The Devil's Dictionary_, 1906 |
Ben Finney

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


Thread

How does this work? <jyoung79@kc.rr.com> - 2011-06-04 01:51 +0000
  Re: How does this work? Ben Finney <ben+python@benfinney.id.au> - 2011-06-05 13:37 +1000
    Re: How does this work? Jon Clements <joncle@googlemail.com> - 2011-06-04 23:32 -0700
      Re: How does this work? Ben Finney <ben+python@benfinney.id.au> - 2011-06-05 16:49 +1000

csiph-web