[issue35040] functools.lru_cache does not work with coroutines

2018-10-22 Thread Andrew Svetlov
Andrew Svetlov added the comment: A coroutine detection is a relatively slow check. I don't think we need to do it in `functools.lru_cache`. There is a specialized asyncio compatible version: https://github.com/aio-libs/async_lru Please use it. --

[issue35040] functools.lru_cache does not work with coroutines

2018-10-21 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35040] functools.lru_cache does not work with coroutines

2018-10-21 Thread Liran Nuna
New submission from Liran Nuna : lru_cache is a very useful method but it does not work well with coroutines since they can only be executed once. Take for example, the attached code (test-case.py) - It will throw a RuntimeError because you cannot reuse an already awaited coroutine. A