bugenhancementhelp wanted
Repository metrics
- Stars
- (705 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
Many times I'll have a function such as
def x():
result = some_long_function_that_eventually_calculates_a_list()
yield from (result.name for result in result)
yield from (result.path for result in result)
I can't cache this function using regular cached_property because the generator will be exhausted. I want to calculate it once, then whenever it is being called again return the items I retrieved in the order I retrieved them.