Skip to content

AI spam#2186

Closed
KirtiRamchandani wants to merge 2 commits into
pallets:mainfrom
KirtiRamchandani:fix/slice-fill-when-evenly-divided
Closed

AI spam#2186
KirtiRamchandani wants to merge 2 commits into
pallets:mainfrom
KirtiRamchandani:fix/slice-fill-when-evenly-divided

Conversation

@KirtiRamchandani

Copy link
Copy Markdown

Summary

Fixes #2118

When the iterable length is evenly divisible by the slice count, the slice filter incorrectly appended fill_with to every slice. Padding should only happen for the trailing partial slice when length does not divide evenly.

Test plan

  • Added test_slice_even_division_does_not_pad covering [1,2,3,4]|slice(4,'X')
  • Existing test_slice still passes

KirtiRamchandani and others added 2 commits June 14, 2026 00:09
When the iterable length is evenly divisible by the slice count,
do not append fill_with to every slice. Fixes pallets#2118.
@davidism davidism closed this Jun 14, 2026
@davidism davidism changed the title Fix slice filter padding when length divides evenly AI spam Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slice returns one extra item when slice count is a divisor of iterable length and fill_with not none

2 participants