GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-144338: Improve cmd.Cmd docs for emptyline() and do_EOF by Anandesh-Sharma · Pull Request #145292 · python/cpython

Conversation

@Anandesh-Sharma

@Anandesh-Sharma Anandesh-Sharma commented Feb 26, 2026 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Summary

Addresses #144338 by improving the cmd.Cmd documentation to make the emptyline() and do_EOF patterns more discoverable:

  • Add a note to cmdloop() docs that do_EOF should be defined to handle Ctrl-D/EOF gracefully, with a cross-reference to the example
  • Add a practical tip to emptyline() docs about overriding with pass to suppress the default repeat-last-command behavior
  • Add emptyline() and do_EOF() methods to the existing TurtleShell example to demonstrate these common patterns

These are the two most commonly needed overrides that new cmd.Cmd users struggle to discover from the current documentation.

Closes #144338

Test plan

  • Documentation builds without warnings
  • Example code in docs is syntactically correct
  • Issue: Add a tutorial for cmd.Cmd for emptyline() and do_EOF #144338

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Anandesh-Sharma @claude
pythongh-144338: Improve cmd.Cmd docs for emptyline() and do_EOF
f9602fb
- Document that do_EOF should be defined to handle Ctrl-D gracefully,
  with a cross-reference to the example
- Add a note to emptyline() docs about overriding with pass to suppress
  the default repeat-last-command behavior
- Add emptyline() and do_EOF() to the TurtleShell example to demonstrate
  these common patterns

Closes python#144338

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@python-cla-bot

python-cla-bot Bot commented Feb 26, 2026

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

  • [email protected]

CLA not signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting review docs Documentation in the Doc dir skip news labels Feb 26, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Feb 26, 2026
@github-project-automation github-project-automation Bot added this to Docs PRs Feb 26, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Feb 26, 2026
Add a tutorial for cmd.Cmd for emptyline() and do_EOF #144338
Open
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label May 7, 2026
@StanFromIreland

StanFromIreland commented Oct 26, 2026

Copy link
Copy Markdown
Member

Closing, CLA is unsigned.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland StanFromIreland closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review docs Documentation in the Doc dir skip news stale Stale PR or inactive for long period of time.

Projects

Docs PRs
Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add a tutorial for cmd.Cmd for emptyline() and do_EOF

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Anandesh-Sharma @StanFromIreland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.