Fabio Pugliese Ornellas <[email protected]> added the comment:
It is worth noting that test frameworks can greatly benefit from iscoroutinefunction to work. I'm the main author of TestSlide, which provides more strict mocking for Python. I recently added async support, so we can detect bugs such as configuring a sync mock for something that is async (https://testslide.readthedocs.io/en/2.0.2/strict_mock/index.html#coroutine-functions-async-def). It works just fine, as long as iscoroutinefunction works, which is not the case for async Cython (a big chunk of TestSlide's use cases). +1 an Andrew's func.__awaitable__ idea: interpreter can provide that for `async def` and one can also do that for anything that implements __call__ to communicate that the callable is async. ---------- nosy: +fornellas _______________________________________ Python tracker <[email protected]> <https://bugs.python.org/issue38225> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
