I just saw the commit 9f3e811556da. I think it can be slightly improved: Instead of
... i = sorted(d.items())
it could simply say
(assuming that i isn't used later).
I will fix/commit this later today, as I do not see any place that i is used again.
Closed; see http://bitbucket.org/fiji/django-3k/changeset/4c9df8291942/