This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Grant Jenks' LRU Cache with TTL for Python | |
| # | |
| # https://stackoverflow.com/questions/31771286/python-in-memory-cache-with-time-to-live/71634221#71634221 | |
| from functools import lru_cache, wraps | |
| from time import monotonic | |
| import typing as t | |
| def lru_cache_with_ttl( |