cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-95601: restore support for awaitable objects that are not futures in `asyncio.wait` and deprecate that support

Open graingert opened this issue 3 years ago • 1 comments

  • Issue: gh-95601
  • Issue: https://github.com/python/cpython/issues/95920

graingert avatar Aug 05 '22 11:08 graingert

Looks like there's something worse going on here. It's possible to put a non-duck type future into wait and reach add_done_callback/remove_done_callback maybe a cf.Future can get in here?

graingert avatar Aug 12 '22 06:08 graingert

FWIW I don't think this should be deferred blocker. cc @pablogsal

kumaraditya303 avatar Aug 27 '22 07:08 kumaraditya303

FWIW I don't think this should be deferred blocker. cc @pablogsal

If is adding a deprecation, is a blocker because we certainly won't be able to do it after the first release. It still needs an exemption though

pablogsal avatar Aug 27 '22 13:08 pablogsal

FWIW I don't think this should be deferred blocker. cc @pablogsal

If is adding a deprecation, is a blocker because we certainly won't be able to do it after the first release. It still needs an exemption though

this is undoing a removal that didn't go via the deprecation policy, and then applying a deprecation for restored functionality

graingert avatar Sep 12 '22 07:09 graingert

Please don't add release-blocker labels without talking to Pablo first.

gvanrossum avatar Sep 12 '22 18:09 gvanrossum

@tiran recommended spitting this PR into two, one that restores the functionality removed without deprecation and one that does the deprecation.

graingert avatar Sep 13 '22 06:09 graingert

It seems that the function was always supposed to only support futures and tasks. If you want to add support of arbitrary awaitables, it should be a new feature. And you need to update the documentation, the docstring and error messages to reflect this.

serhiy-storchaka avatar Sep 14 '22 07:09 serhiy-storchaka

It seems that the function was always supposed to only support futures and tasks. If you want to add support of arbitrary awaitables, it should be a new feature. And you need to update the documentation, the docstring and error messages to reflect this.

that's correct however support for Awaitables is currently available in 3.7, 3.8, 3.9, 3.10 and was removed as a consequence of an incorrectly enforced deprecation in 3.11

I plan to deprecate this support correctly in https://github.com/python/cpython/issues/96783

graingert avatar Sep 14 '22 07:09 graingert

@serhiy-storchaka can you re-review this? I'll add the warning if you and @tiran agree it should be added in this PR.

graingert avatar Sep 28 '22 12:09 graingert

My previous reviews should be discarded as the code has changed since I reviewed. (I don't think I have the permission to dismiss stale reviews.). Since 3.11 is final now, it can't be backported either. I am hoping that @gvanrossum and @1st1 can handle this for 3.12.

kumaraditya303 avatar Oct 27 '22 17:10 kumaraditya303

I think it’s better to start over with a clean slate.

gvanrossum avatar Oct 27 '22 17:10 gvanrossum