-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add missing methods to asyncio stubs #3088
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.
Thank you, just one remark.
In general, all functions marked @coroutine
should actually use async def
, instead, at least for added definitions.
@rchen152 Does pytype not support |
Huh, I'm surprised this hasn't come up before. pytype only supports the |
This is turning out to be more troublesome than I anticipated =( In the meantime, if you'd like to get this PR in without waiting on pytype, maybe |
Let's just use |
Ready for re-review. |
People are starting to want to use this syntax in typeshed: python/typeshed#3088. One odd thing I found is that we were allowing `async.coroutine` as a decorator, which doesn't work once we make async a keyword, but I think the decorator is supposed to be async*io*.coroutine anyway. PiperOrigin-RevId: 257443556
FYI with #3112, pytype should now support the |
The sock_* methods used to return futures, and are now async methods. As noted in the docs: Even though this method was always documented as a coroutine method, releases before Python 3.7 returned a Future. Since Python 3.7 this is an async def method.
Added start_serving to create_server and create_unix_server. Added ssl_handshake_timeout to create_server, create_unix_server, create_connection, create_unix_connection, and connect_accepted_socket.
This reverts commit 66bcf8f.
Reverted to |
@srittau are there any changes I should make to this PR? |
Sorry, I missed this completely. |
Addresses a number of missing methods described in #2313.