-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
asyncio has several names in its __all__
that start with an underscore.
Python 3.15.0a0 (heads/assignannos:9081715ff82, May 25 2025, 08:33:06) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> [x for x in asyncio.__all__ if x.startswith("_")]
['_AbstractEventLoopPolicy', '_get_event_loop_policy', '_set_event_loop_policy', '_set_running_loop', '_get_running_loop', '_register_task', '_unregister_task', '_enter_task', '_leave_task', '_DefaultEventLoopPolicy']
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:
['_set_running_loop', '_get_running_loop', '_register_task', '_unregister_task', '_enter_task', '_leave_task']
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
srittau and efimov-mikhail
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done