Build a manual cached property decorator that computes once and serves the same value.
Constraints
Example
>>> class Example:
... @cached_property
... def value(self):
... print('computing')
... return 42
>>> e = Example()
>>> e.value
computing
42
>>> e.value
42
>>> del e.value
>>> e.value
computing
42
>>> f = Example()
>>> f.value # computes again for a new instance
computing
42
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints