You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
No response
Describe the solution you'd like
The development REPL is a great feature, and tab-completion would make it that much more powerful and easier to work with. I've put together a working proof-of-concept of the dev REPL with tab-completion support at hoffmanr-cshs/sanic@6596625, showing how approachable an implementation could be.
Additional context
The above fork uses the new readline.backend attribute in Python 3.13 and later, and for older versions falls back on checking the readline module's metadata / docstring to detect the backend in use. (testing the contents of the docstring may look a bit janky, but it seems to be what was standard / recommended up until Python 3.13 - see discussion python/cpython#112510 and example, more examples)
I've tested my fork on MacOS with python versions 3.10-3.12, including variants with GNU readline installed. Given that most of the complexity is going to be in dealing with the readline / libedit mess on Mac, hopefully this will cover most of the edgiest cases. With that said, I'm not 100% sure how this would interact with users' own inputrc or editrc files (especially complex ones or unusual key binds), or if that would match the Python built-in interpreter's behavior. More testing would potentially be needed, even beyond just verifying that it runs on different platforms and python versions.
So, I thought it best to raise this as an issue / feature request (rather than just firing a half-baked PR out into the void), to see if there's anyone else as interested in this feature as I am!
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Is your feature request related to a problem? Please describe.
No response
Describe the solution you'd like
The development REPL is a great feature, and tab-completion would make it that much more powerful and easier to work with. I've put together a working proof-of-concept of the dev REPL with tab-completion support at hoffmanr-cshs/sanic@6596625, showing how approachable an implementation could be.
Additional context
The above fork uses the new
readline.backend
attribute in Python 3.13 and later, and for older versions falls back on checking thereadline
module's metadata / docstring to detect the backend in use. (testing the contents of the docstring may look a bit janky, but it seems to be what was standard / recommended up until Python 3.13 - see discussion python/cpython#112510 and example, more examples)I've tested my fork on MacOS with python versions 3.10-3.12, including variants with GNU
readline
installed. Given that most of the complexity is going to be in dealing with thereadline
/libedit
mess on Mac, hopefully this will cover most of the edgiest cases. With that said, I'm not 100% sure how this would interact with users' own inputrc or editrc files (especially complex ones or unusual key binds), or if that would match the Python built-in interpreter's behavior. More testing would potentially be needed, even beyond just verifying that it runs on different platforms and python versions.So, I thought it best to raise this as an issue / feature request (rather than just firing a half-baked PR out into the void), to see if there's anyone else as interested in this feature as I am!
The text was updated successfully, but these errors were encountered: