Skip to content

asyncio REPL: Use self.loop instead of global loop variable in AsyncIOInteractiveConsole #136447

Closed
@injust

Description

@injust

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

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy