Skip to main content
Help us improve Python packaging – donate today!

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

Project Description

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__

Release history Release notifications

History Node

2.0.2

History Node

2.0.1

History Node

2.0.0

History Node

1.4.0

History Node

1.3.1

This version
History Node

1.3

History Node

1.2

History Node

1.1

History Node

1.0.1

History Node

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
ordered-set-1.3.tar.gz (2.6 kB) Copy SHA256 hash SHA256 Source None Jul 21, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page