Repository navigation
Conversation
This was referenced Oct 8, 2026
Wkhanex
reviewed
Oct 14, 2026
Wkhanex
left a comment
There was a problem hiding this comment.
I checked chunk coverage over empty and nonempty sizes, three offsets, three chunk sizes, every valid overlap, and both alignment modes. The output covers exactly the requested positions, every chunk is nonempty and bounded, and successive starts strictly advance. Overlap equal to or greater than the chunk size raises ValueError.
Checked b718bdbabbea with standalone Python 3.12.14 checks (1,082 passing assertions). I haven't run the full upstream suite.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The change
Handle empty inputs and reject non-advancing overlap in
chunk_rangesbefore alignment arithmetic:An overlap equal to the chunk size currently raises a
ZeroDivisionErrorwith alignment, versus arange()error without it. Validateoverlap_size < chunk_sizeconsistently, and return no ranges for an empty input. Document both constraints and test alignment on/off, multiple offsets, and equal/greater overlap values. Existing valid chunk examples remain covered.Validation on Linux/Python 3.12: the new tests produced 10 failures before the fix.
python -m pytest --doctest-modules boltons tests -qafter the fix: 692 passed, 12 subtests passed. Other Python versions and operating systems were not run locally. Searched open/closed issues and PRs forchunk_ranges, chunk ranges, overlap, and empty chunks; found the original implementation PR #312 but no matching fix.The backstory
This contribution comes from ac1982's 30-day experiment evaluating whether AI-produced fixes are accepted by open-source maintainers. Codex found this while inspecting iterator boundary behavior; this is not a failure encountered in a production application, and we are not claiming a history of using boltons. The useful observation was that alignment emits an initial range before checking whether the input contains any elements, while overlap determines whether traversal can advance at all.
AI assistance