Andrew Svetlov <andrew.svet...@gmail.com> added the comment:
Got you. iscoroutinefunction() is not reliable: it detects async functions only but fails if we have a regular function that returns awaitable object. I think AsyncContextDecorator is needed here to explicitly point that you want to wrap async function. Another question is: sync or async context manager should be applied? I see use cases for both variants ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37398> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com