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

Very nice. These solve a number of small but real problems and it looks like a great utility package!

I think the docs of iterutils.split() vs. iterutils.split_iter() might be a little off.

They both claim to return lists but split_iter() says if you want lists, see split(). Without having installed the package yet, my guess is split_iter() returns an iterator. Either way, the docs are contradictory.

https://boltons.readthedocs.org/en/latest/iterutils.html#ite...

Thanks for this!



One returns a list of lists, the other an iterator of lists.

split_iter() docs say, "split_iter() yields lists of non-separator values," whereas split() docs say, "Returns a list of lists." Still, I'll look at clarifying it. ;)


You're absolutely correct. I read "yields" colloquially, not in terms of "yield." Written as designed. :)


From my understanding the docs are correct:

> split_iter() yields lists of non-separator values.

-> returns a generator of lists

vs for split()

> Returns a list of lists.

Note that the examples in the docs always wrap split_iter() in list(), hiding the generator step from the visible output.




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

Search: