gh-143804: highlight default empty-line command repetition in cmd.Cmd documentation#143808
gh-143804: highlight default empty-line command repetition in cmd.Cmd documentation#143808tanloong wants to merge 5 commits intopython:mainfrom
cmd.Cmd documentation#143808Conversation
picnixz
left a comment
There was a problem hiding this comment.
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 still don't think it's worth doing this change. For now I'm going to close this PR and will await some opinion from other core devs. Sorry. |
|
OK. Thanks for taking the time to review this and for explaining your concerns. |
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/