From dda79a9a618bd5f4002753295ef499c8b1f71f27 Mon Sep 17 00:00:00 2001 From: Arthur Lu <learthurgo@gmail.com> Date: Thu, 13 Feb 2025 23:35:05 +0000 Subject: [PATCH] fix python docstring --- cache.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cache.py b/cache.py index e547178..4f5bc48 100644 --- a/cache.py +++ b/cache.py @@ -2,24 +2,24 @@ from abc import ABC, abstractmethod # implements a simple string k-v store, objects should be serialized before putting into the cache class Cache(ABC): - # constructor taking in the cache size limit as number of entries @abstractmethod def __init__(self, limit: int): + """Constructor taking in the cache size limit as number of entries""" pass - # get the value corresponding to key or returns None if there was a cache miss @abstractmethod def get(self, key: str) -> str: + """Get the value corresponding to key or returns None if there was a cache miss""" pass - # set the value corresponding to key and returns True if an eviction was made @abstractmethod def put(self, key: str, val: str) -> bool: + """Set the value corresponding to key and returns True if an eviction was made""" pass - # mark cache item as invalid and returns True if the element was found and invalidated @abstractmethod def invalidate(self, key: str) -> bool: + """Mark cache item as invalid and returns True if the element was found and invalidated""" pass from collections import OrderedDict