Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Here's my own version of an iterating chunker (itertools needed imports omitted).

  def chunks_of(it, n):
    return takewhile(len, imap(list, imap(islice, repeat(it), repeat(n))))
But this library functions adds error checking and are more expressive (I wrote the above and always have to look at it lenghty to understand it).

I've not paid much attention yet to the license scheme, but if it's friendly to be used on commercial projects, I might take the plunge.



BSD, go nuts!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: