Live data from Hacker News

More Itertools

more-itertools.readthedocs.io

11–20 of 51 posts

Re: More Itertools

#12
What's the process for adding these to the Python's stdlib? Is it even possible to adopt a whole library such as this one?

Re: More Itertools

#14
post #12

What's the process for adding these to the Python's stdlib? Is it even possible to adopt a whole library such as this one?

Yes. Unittest.mock used to be a third-party library.

For an idea of the process followed, look up PEP417 (Python Enhancement Proposal.

Re: More Itertools

#16

itertools is a gem and has been since the 2.7 days. Glad to see people waking up to its powerful abstractions.

itertools (iterators) and collections (data structures) are both underrated modules in stdlib.

Re: More Itertools

#17
This library is my python productivity secret weapon. So many things I've needed to impliment in the past is now just chaining functions in itertools, functions, and this

Re: More Itertools

#18
post #11

I've implemented the "chunked" iterator a million times. Glad to see I can just import this next time.

Since python 3.12, builtin itertools now includes a batched method https://docs.python.org/3/library/itertools.html#itertools.b...

Even better! Thanks :)

Re: More Itertools

#19
This looks great.

Usally, I'd cast my arrays into a pandas DF and then use the equivalent dataframe operations. To me, pandas and numpy might as well be part of the python stdlib.

How should I reason about the tradeoff of using something like this vs pandas/numpy ? Esp. with Numpy 2.0 supporting the string dtype.

Re: More Itertools

#20
post #12

What's the process for adding these to the Python's stdlib? Is it even possible to adopt a whole library such as this one?

It must be possible, because the 'dataclasses' library used to be third-party.

That’s not actually true. While dataclasses to most of its inspiration from attrs, there are many features of attrs that were deliberately not implemented in dataclasses, just so it could “fit” in the stdlib.

Or maybe you mean the backport of dataclasses to 3.6 that is available on PyPI? That actually came after dataclasses was added to 3.7.

Source: I wrote dataclasses.

Post reply on HN