4 ms·
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
by geoelectric 12y ago
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#iteration https://boltons.readthedocs.org/en/latest/iterutils.html#ite...
Thanks for this!
- detaro 12y agoFrom 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.
- mhashemi 12y agoOne 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. ;)
- geoelectric 12y agoYou're absolutely correct. I read "yields" colloquially, not in terms of "yield." Written as designed. :)