-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Closed
Copy link
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtopic-asynciotype-featureA feature request or enhancementA feature request or enhancement
Description
I'm trying to extend the asyncio REPL (yes, I know this is an unsupported use case) by doing the following:
from asyncio.__main__ import AsyncIOInteractiveConsole
- Copy the
if __name__ == '__main__'
block into my own__main__.py
- Copy and edit
REPLThread
(subclassing isn't possible because it also refers to global variables)
However, this doesn't work because AsyncIOInteractiveConsole
refers to asyncio.__main__
's global loop
variable, despite it being passed and assigned to the instance attribute self.loop
.
https://github.com/python/cpython/blob/3.13/Lib/asyncio/__main__.py#L65
I see no reason why AsyncIOInteractiveConsole
shouldn't use self.loop
consistently.
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtopic-asynciotype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
Done