67695a80581eca35ed5c8248da0d43e65db09743
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.
Description
My contributions to Suor/funcy: 2 commits, 1 merged PRs
42 KiB
0 Stars
1 Watchers
0 Forks
Languages
Python
100%