Skip to main content
https://badge.fury.io/py/orderedset.png https://travis-ci.org/simonpercivall/orderedset.png?branch=master https://pypip.in/d/orderedset/badge.png

An Ordered Set implementation in Cython. Based on Raymond Hettinger’s OrderedSet recipe.

Example:

>>> from orderedset import OrderedSet
>>> oset = OrderedSet([1, 2, 3])
>>> oset
OrderedSet([1, 2, 3])
>>> oset | [5, 4, 3, 2, 1]
OrderedSet([1, 2, 3, 5, 4])

Features

  • Works like a regular set, but remembers insertion order;

  • Is approximately 5 times faster than the pure Python implementation overall (and 5 times slower than set);

  • Compatible with Python 2.6 through 3.4.;

  • Supports the full set interface;

  • Supports some list methods, like index and __getitem__.

  • Supports set methods against iterables.

Changelog

1.2 - 2015-09-29

  • bugfix: Set operations only worked with iterables if the OrderedSet was on the left-hand side. They now work both ways.

  • bugfix: The order of an intersection was the right-hand side’s order. It is now fixed to be the left-hand side’s order.

1.1.2 - 2014-10-02

  • Make comparisons work with sets and lists, and not crash when compared with None.

1.1.1 - 2014-08-24

  • Add pickle/copy support to OrderedSet

1.1 - 2014-06-04

  • Make OrderedSets handle slicing in __getitem__().

1.0.2 - 2014-05-14

  • Add proper attribution and licenses.

1.0.1 - 2014-05-13

  • Don’t require Cython to build an sdist.

1.0 - 2014-05-11

  • First implementation.

Release files for orderedset 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orderedset 1.2
File Size Uploaded
orderedset-1.2.tar.gz 73.5 kB Details

Release files / orderedset-1.2.tar.gz

Download URL orderedset-1.2.tar.gz
Size 73.5 kB
Tags Source
SHA-256 checksum
How to use checksums
eb5eca027d16e7db2daca90d91842ba47142ce1637944747af53935bbe18d9f1
BLAKE2b-256 checksum
How to use checksums
0043041c9094cb3797bed0708876fabf80934e53e6aeae3ff0cae68f8d5a65b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

2.0.3

1 release file

2.0.2

1 release file

2.0.1

1 release file

2.0

1 release file

This release

1.2 This release

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page