Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
tanloong wants to merge 4 commits into python:main
base: main
Choose a base branch
Loading
from tanloong:cmd-emptyline

Conversation

@tanloong
Copy link
Contributor

@tanloong tanloong commented Jan 13, 2026
edited
Loading

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 to default().


📚 Documentation preview 📚: https://cpython-previews--143808.org.readthedocs.build/

Copy link
Member

@picnixz picnixz left a 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:emptyline is 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.

Copy link

bedevere-app bot commented Jan 13, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@picnixz picnixz picnixz requested changes

Assignees

No one assigned

Labels

awaiting changes docs Documentation in the Doc dir

Projects

Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /