Antoine Pitrou added the comment: > It is trivial. > > def rotate(od, n): > for i in range(n): > k, v = od.popitem(False) > od[k] = v
That's O(n), with many spurious insertions and deletions. > And those functions look too specialized. How so? rotating sounds quite generic to me. deques already allow rotating. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17100> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com