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:
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 files for ordered-set 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ordered-set-1.0.1.tar.gz | 2.1 kB | Details |
Release files / ordered-set-1.0.1.tar.gz
| Download URL | ordered-set-1.0.1.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e946bbb5a689eb5e6f5f1515964e19e5376fde57747767204eb695d9a38ac3c6
|
|
BLAKE2b-256 checksum How to use checksums |
84056b87786d97a542d8029a1e1ef47ba9eee97de5b42c41f601b25fecb24648
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |