Skip to content

gh-83852: Clarify semantics of asyncio.wait with FIRST_COMPLETED/EXCEPTION#21918

Closed
embray wants to merge 2 commits into
python:mainfrom
embray:patch-1
Closed

gh-83852: Clarify semantics of asyncio.wait with FIRST_COMPLETED/EXCEPTION#21918
embray wants to merge 2 commits into
python:mainfrom
embray:patch-1

Conversation

@embray
Copy link
Copy Markdown
Contributor

@embray embray commented Aug 18, 2020

I had a couple (potential) bugs due to the assumption that when using return_when=FIRST_COMPLETED or return_when=FIRST_EXCEPTION the done set would contain only the first completed future.

I did however become suspicious that this may not be the case, and indeed it is not. I wouldn't claim that this behavior is inconsistent with how the function is already documented, but I think it would be helpful to clarify this.

I had a couple (potential) bugs due to the assumption that when using `return_when=FIRST_COMPLETED` or `return_when=FIRST_EXCEPTION` the `done` set would contain only the first completed future.

I did however become suspicious that this may not be the case, and indeed it is not.  I wouldn't claim that this behavior is inconsistent with how the function is already documented, but I think it would be helpful to clarify this.
@tirkarthi
Copy link
Copy Markdown
Member

This seems to be related to https://bugs.python.org/issue39671

@embray
Copy link
Copy Markdown
Contributor Author

embray commented Aug 31, 2020

Ah, I didn't see that issue. Thanks for pointing it out.

@embray embray changed the title Clarify semantics of asyncio.wait with FIRST_COMPLETED/EXCEPTION bpo-39671: Clarify semantics of asyncio.wait with FIRST_COMPLETED/EXCEPTION Aug 31, 2020
@ghost
Copy link
Copy Markdown

ghost commented Sep 20, 2022

The following commit authors need to sign the Contributor License Agreement:

Click the button to sign:
CLA not signed

@willingc
Copy link
Copy Markdown
Contributor

Hi @embray, Please sign the CLA and correct the failing Docs/Docs CI job. I will be happy to review after the changes are made. Thanks.

@AlexWaygood AlexWaygood changed the title bpo-39671: Clarify semantics of asyncio.wait with FIRST_COMPLETED/EXCEPTION gh-83852: Clarify semantics of asyncio.wait with FIRST_COMPLETED/EXCEPTION Jun 21, 2023
@willingc
Copy link
Copy Markdown
Contributor

I'm going to go ahead and close this open PR as stale. The original issue has been closed and referenced to be addressed in a future asyncio tutorial. #83852 (comment)

Thanks @embray for the PR.

@willingc willingc closed this Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants