Skip to main content

A collection that tries to imitate a "lazy" difference and union of sets.

Project description

# LazySet

A collection that tries to imitate a “chained” difference and union of sets and various other operations are performed lazily:

Given a base set, an iterable of sets to subtract from the base set, and an iterable of sets to now add to it (note that the order is important!), a LazySet will act exactly like a regular set and supports all the basic operations, but without actually performing any state-changing unions or differences to any of the participating sets (that take O(number of items in all sets)).

Instead, the LazySet goes over all participating sets according to their order to check if an item is contained in it, thus giving a better run time in some cases for most operations. For example, if the LazySet used is after initialization and no modifying operations were used on it, containment checking takes O(number of participating sets).

Note that when using only difference and union operations, this collection is the set equivalent of ChainMap, so it can also be called ChainSet.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for lazy-set, version 1.4.6
Filename, size File type Python version Upload date Hashes
Filename, size lazy_set-1.4.6-py3-none-any.whl (4.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size lazy_set-1.4.6.tar.gz (3.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page