Ordering is based on internal dictionary implementation
Closed this issue · 1 comments
Ferguzz commented
Correct me if I'm wrong, but doesn't the following code rely purely on the internal implementation of the dict to order the keys in the correct way (0, 1, 2, 3, ..., -3, -2, -1)?
for key, ordered_items in grouped_items.items():
if unordered_items and prev_key >= 0 and key < 0:
sorted_items.extend(unordered_items)
unordered_items = None
prev_key = key
sorted_items.extend(ordered_items)
if unordered_items:
sorted_items.extend(unordered_items)