-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
Closed
Closed
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-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
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
Done