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.0.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for proxyorderedset-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a24a79fdba48e1bbc0ce31f82cec7d87e5109e7ec539acd905b91c0259d6e6cd |
|
MD5 | 06e2d7ed15bbf878e0d31f83439ece69 |
|
BLAKE2b-256 | 7bcf433d06bfa897e33b535617b7279bac6d6c19d3fc173f00dea014bfc129f5 |