def cached_contents(self, path): return path.text()
def cached_contents(self, path): # todo: make a selfmemoize try: return self._cached_contents[path] except KeyError: return self._cached_contents.setdefault(path, path.text())