Skip to content
Snippets Groups Projects
Commit 5ff87e80 authored by Joren Van Onder's avatar Joren Van Onder Committed by Jeremy Kersten
Browse files

[FIX] website: make filter_duplicate work

itertools' groupby function expects the iterable to be sorted as
hinted to in the documentation:

"Generally, the iterable needs to already be sorted on the same key
function."

When running groupby on an unsorted iterable non-adjacent duplicates
will remain:

>>> from itertools import groupby
>>> [e[0] for e in groupby([1, 2, 1])]
[1, 2, 1]

Because of this filter_duplicate would occassionally return
duplicates. To resolve this sort on the key field. Afterwards sort the
result on the usual inherit order: (priority, id).
parent 0e45dfc5
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment