Skip to content

Commit 4872bb9

Browse files
committed
Make the BaseCache class an abstract class.
This is just a matter of cleanup, I can't think of any good reason for this _not_ to be marked abstract.
1 parent c8406a0 commit 4872bb9

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

cachecontrol/cache.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,26 @@
66
The cache object API for implementing caches. The default is a thread
77
safe in-memory dictionary.
88
"""
9+
10+
from abc import ABCMeta, abstractmethod
911
from threading import Lock
1012

13+
from six import add_metaclass
14+
1115

16+
@add_metaclass(ABCMeta)
1217
class BaseCache(object):
18+
@abstractmethod
1319
def get(self, key):
14-
raise NotImplementedError()
20+
pass
1521

22+
@abstractmethod
1623
def set(self, key, value):
17-
raise NotImplementedError()
24+
pass
1825

26+
@abstractmethod
1927
def delete(self, key):
20-
raise NotImplementedError()
28+
pass
2129

2230
def close(self):
2331
pass

0 commit comments

Comments
 (0)