-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-143804: highlight default empty-line command repetition in cmd.Cmd documentation
#143808
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
@picnixz
picnixz
left a comment
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.
Why should we care about LLMs? we don't want documentation that is overly verbose. Otherwise, we would need to do it for every other methods (not just limited to this specific class). The behavior is documented and I find it enough.
Note that if :meth:
emptylineis not overridden, empty input may cause
the previous command to be repeated and passed again to this method.
with "may" it becomes confusing as we don't want will really be happening.
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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.
Uh oh!
There was an error while loading. Please reload this page.
Currently, the only place that explains empty-line repetition is the method-level docstring of Cmd.emptyline(). This is too deep in the page hierarchy and easy to miss. First-time users are surprised when overriding
Cmd.default(), as in #143804.This PR adds an explicit note in the
cmdloop()documentation, that is where users conceptually learn how input is processed.The
default()docstring gives no hint that it may be invoked due to empty input. This PR also adds a single cross-reference sentence todefault().📚 Documentation preview 📚: https://cpython-previews--143808.org.readthedocs.build/