python / cpython

The Python programming language
https://www.python.org
Other
62.55k stars 30.02k forks source link

Please restore the loop param to staggered.staggered_race #124639

Open bdraco opened 4 hours ago

bdraco commented 4 hours ago

Bug report

Bug description:

The following remove the loop param from staggered.staggered_race but its wasn't scheduled for removal until 3.16

https://github.com/python/cpython/pull/124390 https://github.com/python/cpython/pull/124574 https://github.com/python/cpython/pull/124573

CPython versions tested on:

3.12, 3.13, CPython main branch

Operating systems tested on:

No response

Eclips4 commented 4 hours ago

Hello! Thanks for the report.

asyncio.staggered_race should not be used directly. It is a private API that is not documented anywhere in the documentation. If you want to use staggered_race,please install the 3rd party package async-stagger: https://github.com/twisteroidambassador/async_stagger.

bdraco commented 3 hours ago

Its a bit unexpected to have deprecation warnings in it given its not intended for public use. Its also not possible to use https://github.com/twisteroidambassador/async_stagger since it only supports python 3.11+ https://github.com/twisteroidambassador/async_stagger/blob/e09eeefd5d5c123d79abb8ac7f1b5583e8ff3203/setup.py#L30

ZeroIntensity commented 3 hours ago

FWIW, there was no deprecation emitted. That got removed right before the PR got merged. @Eclips4 should we reopen this? I guess this is too much of a breaking change for a patch release.

ZeroIntensity commented 2 hours ago

@bdraco, we're going to add back the loop parameter for 3.12. (I'm not sure what the deprecation plan is, I think it's supposed to be 3.14?)

Anyways, this will allow use of eager_task_factory on prior aiohttp versions. However, we're officially marking staggered_race as a private API (and will rename it to _staggered_race). Please copy the current implementation into third parties for future use, as we're not guaranteeing any future support past 3.12 (or maybe 3.13, I think that's undecided).

bdraco commented 2 hours ago

Thank you!