skip to navigation
skip to content

Not Logged In

ordered-set 1.2

A MutableSet that remembers its order, so that every entry has an index.

Latest Version: 1.3

An OrderedSet is a custom MutableSet that remembers its order, so that every entry has an index that can be looked up.

Based on a recipe originally posted to ActiveState Recipes by Raymond Hettiger, and released under the MIT license:

http://code.activestate.com/recipes/576694-orderedset/

Rob Speer’s changes are as follows:

  • changed the content from a doubly-linked list to a regular Python list. Seriously, who wants O(1) deletes but O(N) lookups by index?
  • add() returns the index of the added item
  • index() just returns the index of an item
  • added a __getstate__ and __setstate__ so it can be pickled
  • added __getitem__
 
File Type Py Version Uploaded on Size
ordered-set-1.2.tar.gz (md5) Source 2014-05-23 2KB
  • Downloads (All Versions):
  • 63 downloads in the last day
  • 406 downloads in the last week
  • 872 downloads in the last month