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.2.tar.gz
(6.7 kB
view hashes)
Built Distribution
Close
Hashes for proxyorderedset-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccb05f8f196092e034c74d7f046a9655a922a4f0dd5038255cc22853f8f3aeb9 |
|
MD5 | 4f27e269f94c8ae937dcd140dfe8da8c |
|
BLAKE2b-256 | 5d32083d4ee46c9027c560decdffb3fdfd3f65643417f396cfe6fab570745d39 |