The slice filter returns one extra item when the slice count can divide the iterable length completely and a fill_with value is used.
Example:
{% set a = [1, 2, 3, 4] %}
{{ a|slice(4, 'foo')|list }}
Output:
[[1, 'foo'], [2, 'foo'], [3, 'foo'], [4, 'foo']]
Expected output:
[[1], [2], [3], [4]]
Environment:
- Python version: 3.10.12
- Jinja version: 3.1.6