Skip to content

Deprecate yield from and @coroutine in asyncio #81102

Closed

Description

@asvetlov
BPO 36921
Nosy @njsmith, @asvetlov, @1st1, @MojoVampire, @miss-islington
PRs
  • bpo-36921: Deprecate @coroutine and yield from in asyncio #13334
  • bpo-36921: Deprecate @coroutine for sake of async def #13346
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-05-24.14:17:40.056>
    created_at = <Date 2019-05-15.08:32:31.751>
    labels = ['3.8', 'expert-asyncio']
    title = 'Deprecate yield from and @coroutine in asyncio'
    updated_at = <Date 2021-04-26.21:17:39.992>
    user = 'https://github.com/asvetlov'

    bugs.python.org fields:

    activity = <Date 2021-04-26.21:17:39.992>
    actor = 'njs'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-05-24.14:17:40.056>
    closer = 'asvetlov'
    components = ['asyncio']
    creation = <Date 2019-05-15.08:32:31.751>
    creator = 'asvetlov'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36921
    keywords = ['patch']
    message_count = 3.0
    messages = ['342649', '372177', '391987']
    nosy_count = 5.0
    nosy_names = ['njs', 'asvetlov', 'yselivanov', 'josh.r', 'miss-islington']
    pr_nums = ['13334', '13346']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue36921'
    versions = ['Python 3.8']

    Activity

    1. miss-islington commented on May 16, 2019

      @miss-islington
      Contributor

      New changeset 68b34a7 by Miss Islington (bot) (Andrew Svetlov) in branch 'master':
      bpo-36921: Deprecate @coroutine for sake of async def (GH-13346)
      68b34a7

    2. MojoVampire commented on Jun 23, 2020

      MojoVampiremannequin
      Mannequin

      Was this supposed to deprecate using types.coroutine as a decorator as well? Because that's not clearly documented, which means people can still use it to make generator-based coroutines without async def.

    3. njsmith commented on Apr 26, 2021

      @njsmith
      Contributor

      @types.coroutine is still useful as a tool for writing "foundation" coroutines that directly interact with the coroutine runner, e.g.:

      https://github.com/python-trio/trio/blob/94562c54d241859eb05ed85c88fd6073d6752ff6/trio/_core/_traps.py#L12-L21

      https://github.com/dabeaz/curio/blob/27ccf4d130dd8c048e28bd15a22015bce3f55d53/curio/traps.py#L28-L36

      So I think it's only @asyncio.coroutine that should be deprecated.

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions