Skip to main content

A python library for memoizing functions for quick debugging/translations

Project description

MemoFN

A python library for memoizing functions for quick debugging/translations.

Usage

from memofn import memofn, load_cache, save_cache

def fib(n):
    if n < 2:
        return n
    return fib(n-1) + fib(n-2)

load_cache('fib.cache.pkl')
mfib = memofn(expire_in_days=9)(fib)
mfib(10)
save_cache('fib.cache.pkl')

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

memofn-0.1.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

memofn-0.1.0-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

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