Ordered-set-37 1.0b1
pip install Ordered-set-37==1.0b1
Newer version available (2.0)
Released:
Dead simple & fast ordered set using python's 3.7+ dict.
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Unlicense
- Author: Xavier Bustamante
Classifiers
- Development Status
- Operating System
- Programming Language
Project description
A dead simple set that preserves insertion order, internally using the python’s 3.7 dict, which preserves order.
This class subclasses and implements all the methods of MutableSet.
x = OrderedSet([1, 2, -1, "bar"])
x.add(0)
assert list(x) == [1, 2, -1, "bar", 0]
This library uses the typing system, so feel free to do:
x: OrderedSet[str] = OrderedSet(("foo", "bar"))
x.add(1) # type checkers won't like this as it is not a string
As an extra, you can access a value by index (although the speed is at worst O(n)):
x = OrderedSet(["foo", "bar", "baz"])
assert x[1] == "bar"
For obvious reasons, this library is only Python 3.7+ compatible.
Feel free to contribute, fork, etc.
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Unlicense
- Author: Xavier Bustamante
Classifiers
- Development Status
- Operating System
- Programming Language
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Ordered-set-37-1.0b1.tar.gz
.
File metadata
- Download URL: Ordered-set-37-1.0b1.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
89a9779c24a8a8bd6bceb9b9668b995412b59056be12e0a65eef70d6aabe1576
|
|
MD5 |
8f8f7d9e621b3fbb5c9f6bcf10087689
|
|
BLAKE2b-256 |
a0faa81f6771ba19aee72002cf89d42abf898a1e895d69e0fee266d85514f26c
|