Repository navigation
asyncio has underscored names in its __all__ #134657
Copy link
Copy link
Closed
Labels
3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on May 25, 2025 - addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on May 25, 2025 IIRC, the private names were added when the policy system was being deprecated cc @kumaraditya303 (I don't know if it was meant for bc)
- added3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixes
on May 25, 2025 Yes, in #128218. I don't see how re-adding them to
__all__under a different name helps backwards compatibility for anyone; it just makes it slightly easier for people to use the private names.Reacted by Mikhail Efimov and Gregory P. SmithIt wasn't for backwards compatibility, it was to reduce the diff when deprecating it, these underscored functions and classes will be removed in 3.16 anyways so making a lot of name changes didn't seem worth it.
__all__is a public API; we shouldn't be using it to make other changes more convenient.Reacted by Gregory P. Smith, Zachary Ware and Mikhail EfimovOkay, I merged your PR.
- linked a pull request that will close this issue[3.14] gh-134657: Remove newly added private names from asyncio.__all__ (GH-134665) #136455
on Jul 9, 2025 - added a commit that references this issue
on Jul 9, 2025
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsDone
Bug report
Bug description:
asyncio has several names in its
__all__that start with an underscore.That feels wrong:
__all__indicates the public names in the module, and names that start with an underscore are not meant to be public.In Python 3.13 there were fewer:
I propose we remove the new additions in 3.14 in both the 3.14 and main branches, and remove the remaining underscored names in 3.15.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs