-
Notifications
You must be signed in to change notification settings - Fork 102
Closed
Labels
enhancementNew feature or requestNew feature or requesthacktoberfestIssues for HacktoberfestIssues for Hacktoberfest
Description
Implement 'batch' filter according to the jinja2 specification:
https://jinja.palletsprojects.com/en/2.10.x/templates/#batch
A filter that batches items. It works pretty much like
slice
just the other way round. It returns a list of lists with the given number of items. If you provide a second parameter this is used to fill up missing items.
For instance, batch(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 three lists:
[[1, 2, 3, 4, 5, 6],
[7, 8, 9, 10, 11, 0],
[12, 13, 14, 15, 16, 0]]
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthacktoberfestIssues for HacktoberfestIssues for Hacktoberfest