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

bpo-42230: Improve asyncio documentation regarding accepting sets vs iterables #23073

Merged

Conversation

jstasiak
Copy link
Contributor

@jstasiak jstasiak commented Nov 1, 2020

People call wait() and as_completed() with various non-set iterables,
a list should be the most common but there are others as well[1].

Considering typeshed also documents wait()[2] and as_completed()[3]
as accepting arbitrary iterables I think it's a good idea to document
the status quo better.

[1] aio-libs/aiokafka#672
[2] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyi#L161
[3] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyi#L40

I believe a news entry can be skipped.

https://bugs.python.org/issue42230

…iterables

People call wait() and as_completed() with various non-set iterables,
a list should be the most common but there are others as well[1].

Considering typeshed also documents wait()[2] and as_completed()[3]
as accepting arbitrary iterables I think it's a good idea to document
the status quo better.

[1] aio-libs/aiokafka#672
[2] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyi#L161
[3] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyi#L40
@asvetlov asvetlov merged commit 3d86d09 into python:master Nov 2, 2020
@miss-islington
Copy link
Contributor

Thanks @jstasiak for the PR, and @asvetlov for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 2, 2020
…iterables (pythonGH-23073)

People call wait() and as_completed() with various non-set iterables,
a list should be the most common but there are others as well[1].

Considering typeshed also documents wait()[2] and as_completed()[3]
as accepting arbitrary iterables I think it's a good idea to document
the status quo better.

[1] aio-libs/aiokafka#672
[2] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyiGH-L161
[3] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyiGH-L40
(cherry picked from commit 3d86d09)

Co-authored-by: Jakub Stasiak <[email protected]>
@miss-islington
Copy link
Contributor

Sorry, @jstasiak and @asvetlov, I could not cleanly backport this to 3.8 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 3d86d090dcbbdfdd3e5a5951cab30612d6131222 3.8

@bedevere-bot
Copy link

GH-23104 is a backport of this pull request to the 3.9 branch.

@asvetlov
Copy link
Contributor

asvetlov commented Nov 2, 2020

I'm ok with skipping the backport to 3.8 if it cannot be done automatically.

@bedevere-bot
Copy link

GH-23105 is a backport of this pull request to the 3.8 branch.

jstasiak added a commit to jstasiak/cpython that referenced this pull request Nov 2, 2020
…ts vs iterables (pythonGH-23073)

People call wait() and as_completed() with various non-set iterables,
a list should be the most common but there are others as well[1].

Considering typeshed also documents wait()[2] and as_completed()[3]
as accepting arbitrary iterables I think it's a good idea to document
the status quo better.

[1] aio-libs/aiokafka#672
[2] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyiGH-L161
[3] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyiGH-L40.
(cherry picked from commit 3d86d09)

Co-authored-by: Jakub Stasiak <[email protected]>
@jstasiak
Copy link
Contributor Author

jstasiak commented Nov 2, 2020

Thanks @asvetlov! I went ahead and created a backport – it was a trivial conflict.

@jstasiak jstasiak deleted the asyncio-document-iterables-not-sets branch November 2, 2020 11:11
miss-islington added a commit that referenced this pull request Nov 2, 2020
…iterables (GH-23073)

People call wait() and as_completed() with various non-set iterables,
a list should be the most common but there are others as well[1].

Considering typeshed also documents wait()[2] and as_completed()[3]
as accepting arbitrary iterables I think it's a good idea to document
the status quo better.

[1] aio-libs/aiokafka#672
[2] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyiGH-L161
[3] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyiGH-L40
(cherry picked from commit 3d86d09)

Co-authored-by: Jakub Stasiak <[email protected]>
asvetlov pushed a commit that referenced this pull request Nov 2, 2020
…ts vs iterables (GH-23073) (GH-23105)

People call wait() and as_completed() with various non-set iterables,
a list should be the most common but there are others as well[1].

Considering typeshed also documents wait()[2] and as_completed()[3]
as accepting arbitrary iterables I think it's a good idea to document
the status quo better.

[1] aio-libs/aiokafka#672
[2] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyiGH-L161
[3] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyiGH-L40.
(cherry picked from commit 3d86d09)

Co-authored-by: Jakub Stasiak <[email protected]>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…iterables (pythonGH-23073)

People call wait() and as_completed() with various non-set iterables,
a list should be the most common but there are others as well[1].

Considering typeshed also documents wait()[2] and as_completed()[3]
as accepting arbitrary iterables I think it's a good idea to document
the status quo better.

[1] aio-libs/aiokafka#672
[2] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyi#L161
[3] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyi#L40
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.

5 participants