Deprecate yield from and @coroutine in asyncio #81102
Copy link
Copy link
Closed
Labels
Description
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']Reactions are currently unavailable
Activity
miss-islington commentedon May 16, 2019
New changeset 68b34a7 by Miss Islington (bot) (Andrew Svetlov) in branch 'master':
bpo-36921: Deprecate @coroutine for sake of async def (GH-13346)
68b34a7
MojoVampire commentedon Jun 23, 2020
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.
njsmith commentedon Apr 26, 2021
@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.