This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Liran Nuna
Recipients Liran Nuna, asvetlov, brett.cannon, xtreak, yselivanov
Date 2019-05-28.20:44:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1559076289.38.0.717847005603.issue35040@roundup.psfhosted.org>
In-reply-to
Content
> A coroutine detection is a relatively slow check.
> I don't think we need to do it in `functools.lru_cache`.

Wouldn't a coroutine check only happen during decoration time? To successfully solve this easily and efficiently, we only really need to wrap the coroutine with `asyncio.ensure_future` if the decorated function is a coroutine, and it will only happen when a result comes back from the decorated function which would have minimal impact.

Of course, I don't know much about the internals of `lru_cache` so my assumptions could be wrong. I should familiar myself with the implementation and figure out how doable it would be.
History
Date User Action Args
2019-05-28 20:44:49Liran Nunasetrecipients: + Liran Nuna, brett.cannon, asvetlov, yselivanov, xtreak
2019-05-28 20:44:49Liran Nunasetmessageid: <1559076289.38.0.717847005603.issue35040@roundup.psfhosted.org>
2019-05-28 20:44:49Liran Nunalinkissue35040 messages
2019-05-28 20:44:49Liran Nunacreate