Commit Graph
5 Commits
Author SHA1 Message Date
dualfroz 836f9fabca Describe this repository 2026-10-22 21:02:30 +02:00
dualfroz a12abd3a5e fix: _cut_iter yields wrong-length parts when step > n
partition()/chunks() on an iterator (_cut_iter) only correctly skipped
step items between parts when step <= n. For step > n, slicing an
n-length pool by pool[step:] silently clips to an empty list, then
islice(it, step) pulled step (not n) fresh items into the pool instead
of first discarding the step - n items between parts. This produced
wrong-length, wrong-content chunks that diverged from the Sequence
code path (_cut_seq) for the same input, e.g. list(range(10)) vs
iter(range(10)) with n=2, step=3.

Branch on step < n to keep the existing sliding-window logic, and for
step >= n explicitly discard the gap before taking the next pool.
2026-09-04 04:48:04 +02:00
upstream f15f2b80fb Upstream Suor/funcy state of the touched files before c0960e614e 2026-09-04 04:48:04 +02:00
dualfroz 67695a8058 fix: _cut_iter yields wrong-length parts when step > n
partition()/chunks() on an iterator (_cut_iter) only correctly skipped
step items between parts when step <= n. For step > n, slicing an
n-length pool by pool[step:] silently clips to an empty list, then
islice(it, step) pulled step (not n) fresh items into the pool instead
of first discarding the step - n items between parts. This produced
wrong-length, wrong-content chunks that diverged from the Sequence
code path (_cut_seq) for the same input, e.g. list(range(10)) vs
iter(range(10)) with n=2, step=3.

Branch on step < n to keep the existing sliding-window logic, and for
step >= n explicitly discard the gap before taking the next pool.
2026-09-06 01:10:29 +02:00
upstream ee14682486 Upstream Suor/funcy state of the touched files before 3a87dd4e11 2026-09-04 04:48:04 +02:00