Skip to content

Deprecate asyncio.iscoroutinefunction #122858

Description

@kumaraditya303

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

Activity

  1. Wulian233 commented on Aug 9, 2024

    @Wulian233
    Contributor

    See #94923 , maybe you can review it :)

  2. Eclips4 commented on Aug 9, 2024

    @Eclips4
    Member

    Looks like an duplicate of #94912

  3. kumaraditya303 commented on Aug 9, 2024

    @kumaraditya303
    ContributorAuthor

    Looks like an duplicate of #94912

    No it isn't, in this issue we are just deprecating it not making an alias.

  4. added a commit that references this issue on Aug 11, 2024
  5. moved this from Todo to Done in asyncioon Aug 11, 2024
  6. added a commit that references this issue on Aug 22, 2024
  7. illia-v commented on Nov 9, 2024

    @illia-v
    Contributor

    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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions