-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Add missing asyncio changes from 3.8 whatsnew #16911
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, Kyle. I've left a couple of comments.
Thanks, it should be most of the way there other than a few minor tweaks. |
Please also mention that |
It looks like the travis CI doc build is failing from the code example not importing asyncio. I thought it was a bit redundant to include that, but I can add it in. |
This is already mentioned in the section "Porting to Python 3.8 > Changes to the Python API". Just to make sure, would you prefer for it to be in "Improved Modules > asyncio" (in the location you specified) instead? Personally I think either section would be okay, I don't have a particularly strong preference in this case. |
Let's mention in both places. It's the most breaking/important change in 3.8 (and ever for asyncio) |
While copying the I wouldn't say this is critical, but it's important that users are able to easily locate the context and reasoning behind the changes (especially for something breaking like this). Edit: Also made a minor grammar typo fix: |
LMK when this is ready for merge. |
@1st1 I just finished double checking the Sphinx rendering from all of the new changes and I believe we covered everything. The only thing I can think of would be waiting for @asvetlov to look over the entries to make sure we didn't miss any significant asyncio changes. But, I recall that he might be otherwise occupied until Friday, so we might want to just move forward with merging these changes. I think there's definitely some value in having the changes out sooner so that any current readers don't miss out on important changes, particularly the deprecations. |
Yes. I do hope that @asvetlov reviews this when he has time, but don't want (a) for people not to know about asyncio changes; (b) put any stress on Andrew. |
Thank you, Kyle! 🚀 |
GH-16912 is a backport of this pull request to the 3.8 branch. |
(cherry picked from commit 3bbb6db) Co-authored-by: Kyle Stanley <aeros167@gmail.com>
The motivation for this PR was from a request by @1st1 to look for and add missing important changes from the 3.8 whatsnew document.
This includes:
Graduation of
asyncio.run()
to the stable API and example of its usage. An example is featured because there wasn't one when it was provisionally added in 3.7 and it's a major change to the high-level API of asyncio.Addition of
asyncio.Task.get_coro()
.Support for Happy Eyeballs algorithm in
asyncio.loop.create_connection()
.Deprecation of passing an explicit loop to several functions and class constructors.
Deprecation of passing coroutine objects to
asyncio.wait()
.Change to
asyncio.wait_for()
to correctly wait for cancellation of asyncio tasks.Change to
asyncio.BaseTransport.get_extra_info()
to return a safe to use socket object.Graduation of
asyncio.BufferedReader
to the stable API.I also moved the ability to name asyncio tasks from "Porting to Python 3.8 > Changes in the Python API" to "Improved Modules > asyncio". This is because the change does not affect the process of upgrading to Python 3.8 and should be in the "Improved Modules > asyncio" section since it's a new feature addition to a commonly used component of asyncio. Also because it added a new method,
asyncio.Task.get_name()
.I believe this includes all of the missing significant user-facing changes made to asyncio in version 3.8. Let me know if I missed anything @1st1 and @asvetlov.