gh-138568: make it the same behavior in repl help mode#138569
gh-138568: make it the same behavior in repl help mode#138569yihong0618 wants to merge 12 commits intopython:mainfrom
Conversation
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
AA-Turner
left a comment
There was a problem hiding this comment.
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 <zouzou0208@gmail.com>
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 <zouzou0208@gmail.com>
adqm
left a comment
There was a problem hiding this comment.
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 <hz@mit.edu>
Thank you its very helpful but two things seem we need to disscuss
Thanks again |
Signed-off-by: yihong0618 <zouzou0208@gmail.com> Co-authored-by: adam j hartz <hz@mit.edu>
|
@adqm Hi the tests code changes but the strip one seems not right in my env |
adqm
left a comment
There was a problem hiding this comment.
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 <hz@mit.edu>
adqm
left a comment
There was a problem hiding this comment.
LGTM. One more minor note from me, and then we'll wait and see what @AA-Turner thinks.
Thanks!
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
AA-Turner
left a comment
There was a problem hiding this comment.
Two minor suggestions, OK otherwise.
A
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
checked its better thanks the hint will fix the test |
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
adqm
left a comment
There was a problem hiding this comment.
One more thought about the updated test cases.
of course its better will commit and check |
Co-authored-by: adam j hartz <hz@mit.edu>
adqm
left a comment
There was a problem hiding this comment.
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.
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".