Skip to main content

Dict that lazily populates itself with items from the iterator it was constructed with as keys are accessed

Project description

IterDicts are almost exactly like regular Python dicts, except that they’re only populated upon demand. This gives them most of the same advantages of generators, such as the ability to operator on very large (or infinite!) datasets. For example:

Accessing keys that aren’t populated yet

>>> d = IterDict((a, a) for a in xrange(1000000000000000))  # 1 quadrillion (US)
>>> d[10]
10

Deleting keys that aren’t populated yet

>>> del d[20]
>>> del d[20]
KeyError: 20

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

IterDict-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file IterDict-0.1.0.tar.gz.

File metadata

  • Download URL: IterDict-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for IterDict-0.1.0.tar.gz
Algorithm Hash digest
SHA256 998a206747b44bf55dd9e53928f98fb57aef6ff0d906c50af5dd3e69e072b3fc
MD5 073d9c6f6bc147923af8439bdb1fd617
BLAKE2b-256 9c9e01c4ba5c54fa35c024361c205704cfbec35b3a58c72d23a0be8706bf3f49

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