Skip to content

Commit 3b3be43

Browse files
committed
Refactor cache import to streamline usage of TTLCache
1 parent 04176be commit 3b3be43

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

ipinfo/cache/default.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
A default cache implementation that uses `cachetools` for an in-memory LRU cache.
33
"""
44

5-
import cachetools
6-
75
from .interface import CacheInterface
8-
6+
from cachetools import TTLCache
97

108
class DefaultCache(CacheInterface):
119
"""Default, in-memory cache."""
1210

1311
def __init__(self, **cache_options):
14-
self.cache = cachetools.TTLCache(**cache_options)
12+
self.cache = TTLCache(**cache_options)
1513

1614
def __contains__(self, key):
1715
return self.cache.__contains__(key)

0 commit comments

Comments
 (0)