-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-84995: Run sys.__interactivehook__() on asyncio REPL startup #20517
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
Conversation
Misc/NEWS.d/next/Library/2020-05-29-18-08-54.bpo-40818.Ij8ffq.rst
Outdated
Show resolved
Hide resolved
Misc/NEWS.d/next/Library/2020-05-29-18-08-54.bpo-40818.Ij8ffq.rst
Outdated
Show resolved
Hide resolved
@1st1 could you review? |
@1st1 is anything missing in this PR? |
Hi @remilapeyre, Is this PR something you still wish to have open? If you would like to move it forward, we would need a signed CLA and merge conflicts resolved. Please close if you do not wish to continue working on this. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please sign CLA and resolve merge conflict. Thanks.
@remilapeyre Could you resolve the conflicts? |
Looks like OP lost interest (or was never notified). I'll add "Pending" label, if there's no response in 30 days just close the PR. |
@remilapeyre Please fix merge conflict. |
Hello, I'm a bit short on time to contribute but will try to put aside some time in the coming weeks to revive the PRs |
@willingc Can i leave this to you? |
gh-116095 is a "re-do" of this PR on top of main (sorry, I don't have access to update this PR directly, but I have credited @remilapeyre as the original author) |
Misc/NEWS.d/next/Library/2020-05-29-18-08-54.bpo-40818.Ij8ffq.rst
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the feature and I like the implementation, but I have a few suggestions to reduce the risk of accidentally breaking code that was relying on implementation details of site.py. (Note that I am fine with moving register_readline()
to the toplevel scope in site.py.)
Lib/site.py
Outdated
def register_readline(): | ||
"""Enable default readline configuration on interactive prompts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, this function is the "interactive hook". The docstring should probably clarify that.
Also, even though it isn't documented, I think we should maintain a function named enablerlcompleter()
which, when calls, does
sys.__interactivehook__ = register_readline
It's likely that someone, somewhere is relying on that function existing, and it's only 2-3 lines to keep them happy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added enablerlcompleter()
back and changed the wording in the docstrings. Should I add enablerlcompleter()
and register_readline()
to the documentation?
Co-authored-by: Itamar Oren <itamarost@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll merge it now. I wouldn't add more docs about this to site.rst, it's intentionally a bit vague.
…python#20517) This makes the asyncio REPL (`python -m asyncio`) more usable and similar to the regular REPL. This exposes register_readline() as a top-level function in site.py, but it's intentionally undocumented. Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Itamar Oren <itamarost@gmail.com>
…python#20517) This makes the asyncio REPL (`python -m asyncio`) more usable and similar to the regular REPL. This exposes register_readline() as a top-level function in site.py, but it's intentionally undocumented. Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Itamar Oren <itamarost@gmail.com>
…python#20517) This makes the asyncio REPL (`python -m asyncio`) more usable and similar to the regular REPL. This exposes register_readline() as a top-level function in site.py, but it's intentionally undocumented. Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Itamar Oren <itamarost@gmail.com>
https://bugs.python.org/issue40818