-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
gh-138568: make it the same behavior in repl help mode #138569
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
base: main
Are you sure you want to change the base?
gh-138568: make it the same behavior in repl help mode #138569
Conversation
Signed-off-by: yihong0618 <[email protected]>
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.
This needs a test. The wording of the NEWS entry should also be significantly improved, it's highly unclear at present.
A
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
copy that, will try to make it better thanks for the review |
Signed-off-by: yihong0618 <[email protected]>
Done sorry for my English...the better news help with LLM |
Please be aware of our policy on use of LLMs and 'generative AI': https://devguide.python.org/getting-started/generative-ai/ |
thank you for let me know that.seems ok here, if not I will change to my own words
|
changed it to my own |
@adqm Would you care to review this, considering your recent work with |
Signed-off-by: yihong0618 <[email protected]>
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 @yihong0618! I think this is indeed an improvement to the interactive help
prompt.
I have a few suggestions, though (one behavioral change, a few stylistic things with the test cases, and a suggested rephrasing of the NEWS entry).
Of course, @ZeroIntensity and @AA-Turner should feel free to chime in if they disagree with any of my suggestions.
Misc/NEWS.d/next/Library/2025-09-06-08-29-08.gh-issue-138568.iZlalC.rst
Outdated
Show resolved
Hide resolved
…ZlalC.rst Co-authored-by: adam j hartz <[email protected]>
Thank you its very helpful but two things seem we need to disscuss
Thanks again |
Signed-off-by: yihong0618 <[email protected]> Co-authored-by: adam j hartz <[email protected]>
@adqm Hi the tests code changes but the strip one seems not right in my env |
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.
Can you clarify the way in which you think this is not working? For example, an input that you provided that gave different output from expected?
For me, it seems to work (I tested this before sending my first review). Both an empty input and an input consisting only of spaces result in just returning me to a new prompt, and asking for help about other things still gives me appropriate help output.
in my side “ ” in help mode |
Yes, if you wrap it in quotes you will get the That feels like the expected behavior to me. I think the handling of |
Get it you are right will change it thank you very much |
Co-authored-by: adam j hartz <[email protected]>
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.
LGTM. One more minor note from me, and then we'll wait and see what @AA-Turner thinks.
Thanks!
Misc/NEWS.d/next/Library/2025-09-06-08-29-08.gh-issue-138568.iZlalC.rst
Outdated
Show resolved
Hide resolved
Signed-off-by: yihong0618 <[email protected]>
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.
Two minor suggestions, OK otherwise.
A
Co-authored-by: Adam Turner <[email protected]>
checked its better thanks the hint will fix the test |
Signed-off-by: yihong0618 <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
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.
One more thought about the updated test cases.
of course its better will commit and check |
Co-authored-by: adam j hartz <[email protected]>
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.
Looks good to me! Just one lingering thought.
if not request or request.isspace(): | ||
continue # back to the prompt | ||
request = request.strip() | ||
|
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 still think the following is cleaner than having the extra .isspace
call. I don't think we're actually saving a string allocation that way, either, since in the case where we would be continuing, .strip()
would take us down to the empty string, which is interned.
But this is a judgement call, and it's ultimately up to @AA-Turner.
if not request or request.isspace(): | |
continue # back to the prompt | |
request = request.strip() | |
request = request.strip() | |
if not request: | |
continue # back to the prompt |
as diff and doc:
To quit this help utility and return to the interpreter,
enter "q", "quit" or "exit".