Closed
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
Projects
Status
Done