-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate using enhanced REPL in Python 3.13 #446
Comments
I've been meaning to look into this, so thank you! Obviously it'd be great to get a public API, but the new REPL is alluring enough that I'd probably be willing to go for a hack like this in the meantime. |
Sounds good! I can work to make the hack as innocent as possible. I started late in the day so I didn't have much time to experiment. In particular I don't know if the readline completer or history got applied with this hack. In parallel we can see if there's any chance of a public API so we can have a better option in the future. |
I did a search through the cpython issues to get an idea if there are already open feature requests. It looks like this is the feature request we're looking for: I think it would be fair to say that this may not be enough for our purposes. In addition to using the |
Python 3.13 introduces a new REPL mode which has several useful items that can be seen in the docs. But the big item in my mind is the multiline editing! It allows you to easily write multiline expressions in a way that would have been quite tedious before.
I'm obviously an enhanced REPL fan so I looked into using the enhanced 3.13 REPL, and unfortunately I don't see any changes to the
code
standard module API to allow using it. I was able to hack something together that works on 3.13 (see the diff below). The issue is that it muddles all around in private modules, which may change in the next release.I'll take a look into the Python bug tracker tomorrow and see whether there are any bug/enhancement requests to add some sort of public interface to the newer features -- really the multiline editing is what I want to see.
The text was updated successfully, but these errors were encountered: