FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-84995: Run sys.__interactivehook__() on asyncio REPL startup by remilapeyre · Pull Request #20517 · python/cpython · GitHub

Repository navigation

gh-84995: Run sys.__interactivehook__() on asyncio REPL startup - #20517

Merged
gvanrossum merged 8 commits into
python:mainfrom
remilapeyre:bpo-40818
Mar 1, 2024
Merged

gvanrossum merged 8 commits into
python:mainfrom
remilapeyre:bpo-40818

Conversation

remilapeyre commented May 29, 2020 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

remilapeyre requested review from 1st1 and asvetlov as code owners May 29, 2020 16:11
remilapeyre changed the title Run sys.__interactivehook__() on asyncio REPL startup bpo-40818: Run sys.__interactivehook__() on asyncio REPL startup May 29, 2020
Comment thread Lib/asyncio/__main__.py Outdated

Copy link
Copy Markdown
Contributor

@1st1 could you review?

Copy link
Copy Markdown

@1st1 is anything missing in this PR?

ghost commented Jul 5, 2022 •
edited by ghost
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

Copy link
Copy Markdown
Contributor

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.

willingc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please sign CLA and resolve merge conflict. Thanks.

Copy link
Copy Markdown
Contributor

@remilapeyre Could you resolve the conflicts?

gvanrossum changed the title bpo-40818: Run sys.__interactivehook__() on asyncio REPL startup gh-84995: Run sys.__interactivehook__() on asyncio REPL startup Aug 23, 2023

Copy link
Copy Markdown
Member

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.

gvanrossum added the pending The issue will be closed if no feedback is provided label Aug 23, 2023

Copy link
Copy Markdown
Member

@remilapeyre Please fix merge conflict.

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Member

@willingc Can i leave this to you?

itamaro commented Feb 29, 2024

Copy link
Copy Markdown
Contributor

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)

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.)

Comment thread Lib/site.py Outdated
Comment on lines +460 to +461
def register_readline():
"""Enable default readline configuration on interactive prompts.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I added enablerlcompleter() back and changed the wording in the docstrings. Should I add enablerlcompleter() and register_readline() to the documentation?

Comment thread Lib/site.py Outdated
Comment thread Lib/site.py Outdated
Comment thread Lib/asyncio/__main__.py Outdated
Rémi Lapeyre and others added 2 commits March 1, 2024 09:50
Co-authored-by: Itamar Oren <itamarost@gmail.com>
remilapeyre requested a review from gvanrossum March 1, 2024 09:13

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks! I'll merge it now. I wouldn't add more docs about this to site.rst, it's intentionally a bit vague.

gvanrossum merged commit b5949ea into python:main Mar 1, 2024
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this pull request Mar 4, 2024
…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>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
…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>
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.


Back | FazBrowse Home | New Git URL