Top-rated recipes tagged "ordered" Code RecipesOrderedSet (Python) 2012-12-19T07:12:32-08:00Raymond Hettinger <p style="color: grey"> Python recipe 576694 by <a href="/recipes/users/178123/">Raymond Hettinger</a> (<a href="/recipes/tags/ordered/">ordered</a>, <a href="/recipes/tags/set/">set</a>). Revision 9. </p> <p>Set that remembers original insertion order.</p> Ordered Listbox for Tkinter (Python) 2017-02-11T19:01:52-08:00Miguel Martínez López <p style="color: grey"> Python recipe 580756 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/listbox/">listbox</a>, <a href="/recipes/tags/ordered/">ordered</a>, <a href="/recipes/tags/sort/">sort</a>, <a href="/recipes/tags/sorted/">sorted</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 6. </p> <p>Listbox megawidget showing ordered strings. It's possible to ignore case. I also provided an auto scrollbar option.</p> Ordered Dictionary for Py2.4 (Python) 2011-04-24T03:20:45-07:00Raymond Hettinger <p style="color: grey"> Python recipe 576693 by <a href="/recipes/users/178123/">Raymond Hettinger</a> (<a href="/recipes/tags/dictionary/">dictionary</a>, <a href="/recipes/tags/linked_list/">linked_list</a>, <a href="/recipes/tags/ordered/">ordered</a>). Revision 9. </p> <p>Drop-in substitute for Py2.7's new collections.OrderedDict. The recipe has big-oh performance that matches regular dictionaries (amortized O(1) insertion/deletion/lookup and O(n) iteration/repr/copy/equality_testing).</p> OrderedSet (Python) 2015-06-25T17:33:13-07:00Sander <p style="color: grey"> Python recipe 579071 by <a href="/recipes/users/4192426/">Sander</a> (<a href="/recipes/tags/ordered/">ordered</a>, <a href="/recipes/tags/set/">set</a>). </p> <p>Set that remembers original insertion order.</p> Yet Another Ordered Dictionary (Python) 2011-08-07T12:14:56-07:00Lucio Santi <p style="color: grey"> Python recipe 577826 by <a href="/recipes/users/4178886/">Lucio Santi</a> (<a href="/recipes/tags/dict/">dict</a>, <a href="/recipes/tags/dictionary/">dictionary</a>, <a href="/recipes/tags/linked_list/">linked_list</a>, <a href="/recipes/tags/ordered/">ordered</a>). </p> <p>An implementation of dictionaries preserving key insertion order. Despite using a doubly-linked list to keep track of the appropriate order, this list is actually embedded in the dictionary. As a consequence, there is little space penalty, and also every operation exhibits an efficient implementation (i.e., no need to perform lookups or deletions multiple times, as it happens with other versions of this data structure).</p>