General purpose efficient memoization
Project description
Memoized
The common general versions of memoized decorators ([1], [2], [3]) are often good enough but they incur some overhead that can be avoided in more special cases ([4]). This package exposes a single callable, memoized, that picks an efficient memoization implementation based on the decorated function’s signature and a few user provided options. The included benchmark file gives an idea of the performance characteristics of the different possible implementations.
Additionally, memoized allows:
Creating signature preserving decorators (through the decorator module).
Passing an external object as the underlying storage (e.g. an LRU cache) instead of a dict that is used by default.
More options for customization and optimization may be added in the future.
News
0.3
Python 3 compatibility.
0.2
Add hashable parameter.
Make it possible to use @memoized as equivalent of @memoized().
0.1
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file memoized-0.3.tar.gz
.
File metadata
- Download URL: memoized-0.3.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdce8bacc6941a64f9a825067602c13810cfd9b84efaaf024c400ef6e7d378d8 |
|
MD5 | 08c12a0c486ddbb655815c369cd2295b |
|
BLAKE2b-256 | 7b9b91731f60e6fba2c476b69dfe80dbf748b639a9ab559656928474235d62c6 |