Tzu-ping Chung <uranu...@gmail.com> added the comment: > should not use asyncio directly but 'async def', 'await', and > `inspect.iscoroutine()` / `inspect.iscoroutinefunction()` instead.
Hmm, this introduces some difficulties. Since a coroutine can only be awaited once, a new coroutine needs to be returned (that simply return the result when awaited) each time __get__ is called. But this means we need a way to somehow get the result in __get__. If there’s a separate `cached_property_async` it’s possible to make __get__ a coroutine function, but personally I’d prefer the interface to match the PyPI cached_property. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46622> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com