gh-122858: Deprecate `asyncio.iscoroutinefunction` by Wulian233 · Pull Request #122875 · python/cpython

@Wulian233

…ect.iscoroutinefunction`.

@Wulian233

@Wulian233

kumaraditya303

kumaraditya303

@kumaraditya303

kumaraditya303

@Wulian233

@Wulian233

kumaraditya303

@kumaraditya303

kumaraditya303

@Wulian233

sobolevn

@kumaraditya303

kumaraditya303

blhsing pushed a commit to blhsing/cpython that referenced this pull request

Aug 22, 2024
Deprecate `asyncio.iscoroutinefunction` in favor of `inspect.iscoroutinefunction`.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>

AdamWill pushed a commit to AdamWill/cached-property that referenced this pull request

Nov 5, 2024
Python 3.14 will deprecate asyncio.iscoroutinefunction:
python/cpython#122875

inspect.iscoroutinefunction exists since 3.5 and our baseline
is 3.8, so we can just use it unconditionally.

Using a wrapper with @asyncio.coroutine in __get__ wasn't
necessary (the future from asyncio.ensure_future is awaitable,
and the wrapper doesn't do anything asynchronous), so the
logic can be simplified to just call asyncio.ensure_future
(to schedule the task and store the result when it's
available).

layday added a commit to layday/aiohttp that referenced this pull request

Mar 29, 2025

This was referenced

Mar 29, 2025

jenshnielsen added a commit to jenshnielsen/opentelemetry-python that referenced this pull request

Oct 22, 2025
asyncio.iscoroutinefunction is a wrapper around inspect.iscoroutinefunction and has been deprecated in 3.14

See python/cpython#122875 for reference