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


Groups > comp.lang.python > #7036

Re: How does this work?

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>
Date 2011-06-05 16:49 +1000
Message-ID <874o444vsg.fsf@benfinney.id.au> (permalink)
Organization Unlimited download news at news.astraweb.com

Show all headers | 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