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.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

proxyorderedset-0.3.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file proxyorderedset-0.3.1.tar.gz.

File metadata

  • Download URL: proxyorderedset-0.3.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for proxyorderedset-0.3.1.tar.gz
Algorithm Hash digest
SHA256 8c05f7a1adc95520c02e61a478ce5da03e52777a9b51af43ebf9fc083190c78e
MD5 46732ece3543b8b9226877b1cf653f8c
BLAKE2b-256 2a0c1fa906ba947fa1db139e2f82da477507b01b2ddabb3ee3ece4f7c36686cc

See more details on using hashes here.

File details

Details for the file proxyorderedset-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for proxyorderedset-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d0cc23f245a336deabf4343fcd4e2e6d14c4eed03b6501440646aa0edbad855
MD5 cc8a7b3281114c5ec6a4b7f79f53fcad
BLAKE2b-256 870d22f6e87e8d3713905b77131dd287e6cbfd3366f6ff394229dc6c58ab06f2

See more details on using hashes here.

Supported by

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