A simple implementation of ordered sets as a proxy to Python's standard dict class.
Project description
(Proxy-) OrderedSet
A simple implementation of ordered sets as a proxy to Python's standard dict class.
The implementation is based on the idea to take a base
iterable and create a dict using dict.fromkeys(base)
. Keys
are unique, and in newer versions of Python, the order is kept; values are None
and ignored.
This package has no external dependencies. The OrderedSet class overwrites all set
methods.
Example
from orderedset import OrderedSet
s: OrderedSet[int] = OrderedSet([3, 1, 4, 1])
list(s) # yields [3, 1, 4]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
proxyorderedset-0.3.5.tar.gz
(6.9 kB
view hashes)
Built Distribution
Close
Hashes for proxyorderedset-0.3.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c123c033ff3bc8003120e5602f31e62c38e13f983f7abb2f4c04ca054fb1413 |
|
MD5 | 4313d9aa4261081f51746b6c2b16770f |
|
BLAKE2b-256 | 1ade4459a7fef62064be7811fe1ec34b7f0e59826f6cbd6bf7ac6e70542f1e39 |