Movatterモバイル変換


[0]ホーム

URL:


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 incmd.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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
tanloong wants to merge5 commits intopython:mainfromtanloong:cmd-emptyline

Conversation

@tanloong
Copy link
Contributor

@tanloongtanloong commentedJan 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 overridingCmd.default(), as in#143804.

This PR adds an explicit note in thecmdloop() documentation, that is where users conceptually learn how input is processed.

Thedefault() 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/

Copy link
Member

@picnixzpicnixz 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.

@bedevere-app
Copy link

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 phraseI 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.

@picnixz
Copy link
Member

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.

@tanloong
Copy link
ContributorAuthor

OK. Thanks for taking the time to review this and for explaining your concerns.

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

Reviewers

@picnixzpicnixzpicnixz requested changes

Assignees

No one assigned

Labels

awaiting changesdocsDocumentation in the Doc dir

Projects

Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@tanloong@picnixz

[8]ページ先頭

©2009-2026 Movatter.jp