Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sqlite_utils.utils.chunks a documented function #451

Closed
simonw opened this issue Jul 8, 2022 · 2 comments
Closed

Make sqlite_utils.utils.chunks a documented function #451

simonw opened this issue Jul 8, 2022 · 2 comments

Comments

@simonw
Copy link
Owner

simonw commented Jul 8, 2022

I want to use it in another project:

def chunks(sequence, size):
iterator = iter(sequence)
for item in iterator:
yield itertools.chain([item], itertools.islice(iterator, size - 1))

@simonw
Copy link
Owner Author

simonw commented Jul 15, 2022

@simonw simonw closed this as completed in e10536c Jul 15, 2022
@simonw
Copy link
Owner Author

simonw commented Jul 15, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant