Skip to main content

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)

Uploaded Source

Built Distribution

proxyorderedset-0.3.5-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page