import functools class A: @property def x(self): pass @property @functools.lru_cache() def y(self): self.x A().y