Skip to content

Implement 'slice' filter #141

Closed
Closed
@flexferrum

Description

@flexferrum

Implement slice filter according the jinja2 documentation:

Slice an iterator and return a list of lists containing those items.
If you pass it a second argument it’s used to fill missing values on the last iteration.

For instance, slice(3, 0) applied to the list [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] should give the list of lists of three items each:

[[1, 2, 3],
 [4, 5, 6],
 [7, 8, 9],
 [10, 11, 12],
 [13, 14, 15],
 [16, 0, 0]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions