Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use async/await through asyncio docs #69687

Closed
brettcannon opened this issue Oct 28, 2015 · 6 comments
Closed

Use async/await through asyncio docs #69687

brettcannon opened this issue Oct 28, 2015 · 6 comments
Labels
docs Documentation in the Doc dir easy type-feature A feature request or enhancement

Comments

@brettcannon
Copy link
Member

BPO 25501
Nosy @gvanrossum, @brettcannon, @pitrou, @vstinner, @giampaolo, @ezio-melotti, @asvetlov, @1st1

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 2015-10-29.20:34:26.301>
created_at = <Date 2015-10-28.22:30:53.589>
labels = ['easy', 'type-feature', 'docs']
title = 'Use async/await through asyncio docs'
updated_at = <Date 2015-10-29.20:34:26.301>
user = 'https://github.com/brettcannon'

bugs.python.org fields:

activity = <Date 2015-10-29.20:34:26.301>
actor = 'brett.cannon'
assignee = 'docs@python'
closed = True
closed_date = <Date 2015-10-29.20:34:26.301>
closer = 'brett.cannon'
components = ['Documentation']
creation = <Date 2015-10-28.22:30:53.589>
creator = 'brett.cannon'
dependencies = []
files = []
hgrepos = []
issue_num = 25501
keywords = ['easy']
message_count = 6.0
messages = ['253636', '253641', '253644', '253645', '253684', '253692']
nosy_count = 9.0
nosy_names = ['gvanrossum', 'brett.cannon', 'pitrou', 'vstinner', 'giampaolo.rodola', 'ezio.melotti', 'asvetlov', 'docs@python', 'yselivanov']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = 'needs patch'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue25501'
versions = ['Python 3.6']

@brettcannon
Copy link
Member Author

The asyncio docs still use yield from and @asyncio.coroutine all over the place instead of async/await. It would be best to update the docs to follow best practices (unless there is some reason I can't think of as to why this hasn't happened yet).

@brettcannon brettcannon added the docs Documentation in the Doc dir label Oct 28, 2015
@ezio-melotti ezio-melotti added easy type-feature A feature request or enhancement labels Oct 28, 2015
@gvanrossum
Copy link
Member

It makes it more awkward to keep the asyncio docs in sync between 3.4 and 3.5. Also it makes copying examples harder for users who need compatibility with 3.4 or 3.3.

@asvetlov
Copy link
Contributor

Also sphinx (pygments actually) still do not support async/await syntax highlighting yet.

@asvetlov
Copy link
Contributor

We have dropped 3.3 in aiohttp BTW.
Proper handling of resource leaks is too annoying without PEP-442 which don't crash with core dump starting from Python 3.4.1

@brettcannon
Copy link
Member Author

Once 3.4.4 launches the need to keep the docs synced with a version that doesn't support async/await goes away. And worrying about 3.3 isn't necessary since asyncio was added in 3.4.

So once 3.4.4 is released and we close the 3.4 branch to bugfixes can we update the docs in asyncio and add a note at the top saying the examples all use async/await from 3.5 and if you need 3.4 compatibility to please look at the 3.4 docs? Otherwise how long do you want to wait until we can start using async/await in the documentation? My worry is that people are going to blindly copy the examples and tweak them for their needs since the asyncio docs are a bit dense and thus just simply overlook the fact that async/await exists.

@gvanrossum
Copy link
Member

Honestly I think it's better if most people keep using coroutine/yield-from instead of async/await for a few more releases; their code will be more portable, since it takes forever to update old datacenters. We put in async/await with an eye towards the future. But we're keeping yield-from around for a long time too. And that's also why we support asyncio for 3.3.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir easy type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants