0

cache: fix code style

This commit is contained in:
Nicolas F
2019-03-07 15:43:01 +01:00
parent 94aa49019c
commit fc88572aa3

View File

@@ -21,6 +21,7 @@ attribute.
"""
class LRUCache(object):
"""A simple, generic, in-memory LRU cache that implements the standard
python container interface.
@@ -40,6 +41,7 @@ class LRUCache(object):
"""
class _LinkNode(object):
__slots__ = ['left', 'right', 'key', 'value']
def __init__(self, l=None, r=None, k=None, v=None):
self.left = l
self.right = r
@@ -73,6 +75,7 @@ class LRUCache(object):
# Initialize an empty cache of the same size for worker processes
def __getstate__(self):
return self.size
def __setstate__(self, size):
self.__init__(size)