GeezerVison is showing github.com — Deprecate `asyncio.iscoroutinefunction` · Issue #122858 · python/cpython
Deprecate asyncio.iscoroutinefunction #122858
Description
asyncio.iscoroutinefunction should be deprecated in favor of inspect.iscoroutinefunction, we don't need two different functions to do the same thing. I propose to deprecate asyncio.iscoroutinefunction because IMO these introspection functions don't belong to asyncio but more to inspect module. It will be deprecated in Python 3.14 and scheduled for removal in Python 3.16.
Linked PRs
Reacted by Kirill Podoprigora, Wulian233 and Elnazar Ulanbek uulu
Activity
Wulian233 commented on Aug 9, 2024
See #94923 , maybe you can review it :)
Eclips4 commented on Aug 9, 2024
Looks like an duplicate of #94912
kumaraditya303 commented on Aug 9, 2024
ContributorAuthor
More actions
Looks like an duplicate of #94912
No it isn't, in this issue we are just deprecating it not making an alias.
Reacted by Kirill Podoprigora and Wulian233
illia-v commented on Nov 9, 2024
If you get the deprecation error and want to support Python < 3.12, you may need to still use asyncio.iscoroutinefunction conditionally for backward compatibility because before #94050 merged into 3.12 (and only some 3.10 and 3.11 releases) the functions hadn't been equivalent
if sys.version_info >= (3, 12):
iscoroutinefunction = inspect.iscoroutinefunction
else:
iscoroutinefunction = asyncio.iscoroutinefunction
Metadata
Metadata
StatusShow more project fields
Development
No branches or pull requestsIssue actions