-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
asyncio.wait function creates futures set two times #86306
Comments
The python3.9 code creates the futures set two times. This python3.9 behaviour breaks the aiokafka library, because it gives an iterator to that function, so the second iteration become empty. |
Are you suggesting this is a bug, or is it just a suggested code cleanup? I ask because the docs suggest that a set should be passed: And the docstring says it should be a sequence: Lines 373 to 376 in d1a0a96
So while code cleanup is okay, I'm not sure support for general iterator arguments can / should be guaranteed. |
The current error message is way too cryptic anyway. And restricting it to the set type only, as in docs, will certainly break a lot of code (passing a list is quite common). |
It is a suggested code cleanup. My point is that the code creates two sets based on the Sequence Em dom., 25 de out. de 2020 às 18:57, Chris Jerdonek <report@bugs.python.org>
|
Your change makes perfect sense to me. It would be a backport-only change as the 2nd set creation is actually getting removed for the development version (3.10) to finalize the deprecation of wait's coroutine scheduling. |
If it's just a code cleanup and not a bugfix though, it shouldn't be backported. But yes, as a cleanup it's fine. And even if it's expected to go away later, it's okay to do now. |
I believe the documentation may be referring to the English set and not a Python set, but I could be wrong. Yury changed the wording from sequence to set in 3.7, but we didn't document a breaking change as far as I know. The purpose of those set constructions was to handle the many things other than a set that can be passed in that may have non-unique values. Early asyncio documentation included examples of passing wait() a list. I wouldn't be surprised if there are other libraries or apps out there for which removing iterator support was an accidentally-breaking change and it may be strange if this is only is broken in 3.9.x, but working both before and after. |
Justin, when the deprecation message has been removed, the iterator will My changes proposal is a “improvement”, because the second iteration can be I think that change make senses because it removes unnecessary data Em ter, 27 de out de 2020 às 00:24, Justin Arthur <report@bugs.python.org>
|
|
I opened https://bugs.python.org/issue42230 to make the documentation reflect the reality in this matter. |
Thanks for the change and for the discussion to everybody involved. The PR makes sense and I've already merged it. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: