Skip to main content

dict that allows dependency definition.

Project description

An AutoRecalcDict is a subclass of dict that allows the user to create a standard python dict, but to also allow specifications for dependency lists that are on specific targets. Typical usage would be when you want a dict entry to automagically be recomputed if a dependency changes.

For example:

ard is an AutoRecalcDict and has keys called ‘target’, ‘dep1’, ‘dep2’ and ‘dep3’. The user wants the value of ard[‘target’] to be recomputed via a user defined function ff.

The calling sequence of function ff is defined as having three arguments: 1. self (ff will be converted to an instance method of ard) 2. target (the index into ard) 3. deplist (the list of keys that target depends upon).

Included in autorecalcdict.py is a class called DepDescFunc. This is used to create the instance needed by AutoRecalcDict to know what targets are dependent on which dependency lists and the function needed to update the target.

See the module for examples of usage.

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

AutoRecalcDict-0.1.1.zip (17.5 kB view details)

Uploaded Source

File details

Details for the file AutoRecalcDict-0.1.1.zip.

File metadata

  • Download URL: AutoRecalcDict-0.1.1.zip
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for AutoRecalcDict-0.1.1.zip
Algorithm Hash digest
SHA256 2aa33461fdece230686b1a62fea9ed68f514d19873f172de34149531e4a7c5fc
MD5 e5b4e6f54e1b1961908e8bab3cf96f85
BLAKE2b-256 0c69ddca80f306f630f9948d1cd4cc411f12dc5a9ad65df3f46bb8d29e65acec

See more details on using hashes here.

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