ALL-OVER0001 · examples
These examples come directly from ALL-OVER0001. Read their source.
class Reader: def load(self, path, encoding): return open(path, encoding=encoding).read()
class CachedReader(Reader): def load(self, path): return self.cache[path]class CachedReader(Reader): def load(self, path, encoding): return self.cache.get(path) or super().load(path, encoding)