Hacker News new | past | comments | ask | show | jobs | submit login

Speaking of standard lib, today I was looking to do a sliding window over an iterator and ended up on the pairwise function in itertools that was added in 3.10.

Seems like such a wasted opportunity, to add a sliding window for n=2, and then in the documentation add a recipe for a sliding window function for any n.




There are a lot of things like this in the boltons library: https://boltons.readthedocs.io/en/latest/iterutils.html#bolt...

It's nice to not have to depend on anything external, but boltons is something I just treat as an expanded part of the standard library.




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

Search: