Skip to content

Instantly share code, notes, and snippets.

@adah1972
adah1972 / hashable_cache.py
Last active July 31, 2023 17:00
Decorator for using dicts/lists with any Python cache function (like lru_cache)
# Inspired by https://gist.github.com/harel/9ced5ed51b97a084dec71b9595565a71
from collections import namedtuple
import functools
import json
import six
Serialized = namedtuple('Serialized', 'json')