Skip to content

File cache.py

File List > mkdoxy > cache.py

Go to the documentation of this file

class Cache:
    def __init__(self):
        self.cachecache = {}

    def add(self, key: str, value):
        self.cachecache[key] = value

    def get(self, key: str):
        if key in self.cachecache:
            return self.cachecache[key]
        else:
            raise IndexError(f"Key: {key} not found in cache!")