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.3.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for proxyorderedset-0.3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0e65de9832d9a0e68c6079dae47a46b17fc00f4c600c9bf68806bf5efbd755f |
|
MD5 | 8d470f681727b5c61d41c110a6b3765e |
|
BLAKE2b-256 | 036e084d3621b5162349ebee08cb13b05a7f3e9c294b5260ae64cc280a3f9db9 |