Message413225
Note that there is a similar issue with cached generators.
>>> from functools import *
>>> @lru_cache()
... def g():
... yield 1
...
>>> list(g())
[1]
>>> list(g())
[]
I am not sure that it is safe to detect awaitables and iterables in caching decorators and automatically wrap them in re-awaitable and re-iterable objects. But we can add explicit decorators and combine them with arbitrary caching decorators. For example:
@lru_cache()
@reiterable
def g():
yield 1 |
|
Date |
User |
Action |
Args |
2022-02-14 14:35:52 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, asvetlov, yselivanov, uranusjr |
2022-02-14 14:35:52 | serhiy.storchaka | set | messageid: <1644849352.23.0.647319191588.issue46622@roundup.psfhosted.org> |
2022-02-14 14:35:52 | serhiy.storchaka | link | issue46622 messages |
2022-02-14 14:35:52 | serhiy.storchaka | create | |
|