Skip to content

A new Python REPL #111201

Description

@pablogsal

This issue will track all the different steps to bootstrap a new Python REPL with many new features. The target of this issue is that we can reach a point where new contributions can be made easily to the REPL once is written in pure Python. This issue only coveres the initial ground work to reach this status.

Tasks to be done:

  • Redirect the parser and the main module to a new Python module.
  • Fallback to the previous tokenizer-based REPL if the terminal is not a tty (and for backwards compat reasons)
  • Bootstrap a new REPL module (based on a trimmed version pypy's pyrepl module).
  • Ensure that the basic features work:
    • History
    • Completions
    • Ctrl-r and Ctrl-s

Linked PRs

Activity

  1. pablogsal commented on Oct 23, 2023

    @pablogsal
    MemberAuthor

    If you want to help with this endeavour, please mention it here so we can coordinate everyone!

  2. pablogsal commented on Oct 23, 2023

    @pablogsal
    MemberAuthor

    I have a initial version that we can start building upon, I will create a PR shortly.

  3. tomasr8 commented on Oct 23, 2023

    @tomasr8
    Member

    I learned about this from the "core.py" podcast and it sounds like a great idea! I'd be happy help with this effort :)

  4. added a commit that references this issue on Oct 31, 2023
  5. vstinner commented on Nov 1, 2023

    @vstinner
    Member

    Fallback to the previous tokenizer-based REPL if the terminal is not a tty (and for backwards compat reasons)

    Do you mean not using _pyrepl? Can _pyrepl be used without readline nor tty?

  6. pablogsal commented on Nov 1, 2023

    @pablogsal
    MemberAuthor

    Can _pyrepl be used without readline nor tty?

    It needs at least a tty yes. Readline can be lifted but I am not sure yet

  7. added a commit that references this issue on Apr 27, 2024
  8. novaTopFlex commented on Apr 28, 2024

    @novaTopFlex

    I would like to see a new REPL (read, evaluate, print, loop) for the Python interpreter if the interpreter goes by a different name. Two other major Python interpreters also exist, and they already use other names ("bpython" and "ipython"). I would recommend forking the current REPL and renaming the interpreter with the new REPL to "zpython" instead. Also, I would like to see a built-in "clear()" function in the REPL as I already encounter with the "exit()" function and other REPL-specific functions.

  9. added a commit that references this issue on May 5, 2024
  10. theLastOfCats commented on May 5, 2024

    @theLastOfCats

    Big feature without PEP?

  11. 116 remaining items

  12. added 6 commits that reference this issue on Jul 17, 2024
  13. added 2 commits that reference this issue on Aug 19, 2024
  14. added a commit that references this issue on Sep 6, 2024
  15. added a commit that references this issue on Sep 6, 2024
  16. added a commit that references this issue on Sep 6, 2024
  17. lysnikolaou commented on Sep 23, 2024

    @lysnikolaou
    Member

    I think we can close this and handle the rest of the bugs in individual issues. Feel free to re-open if you feel otherwise.

  18. 0dminnimda commented on Oct 15, 2024

    @0dminnimda

    Thanks to all the participants, this is amazing! I really enjoy its increased portability!

  19. HarbingerOfFire commented on May 24, 2025

    @HarbingerOfFire

    I absolutely love this change! I was using 3.12 and was thinking about making the change myself when I found this. Thank you all for your dedication!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

topic-replRelated to the interactive shell

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions