python / python/cpython

Undocumented Cmd method print_topics

Open
#128,430 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Documentation

When exploring the Cmd Python library, I realized that there is no documentation for print_topics method.

I only realized the missing documentation because I noticed that print_topics method has an unused parameter called cmdlen, and I couldn't figure out if it is actually useful for something.
I could also notice that on typeshed it is typed as Any, even though it seems to be only used as an int.

Extra doubts:

Maybe print_topics should be renamed to _print_topics or we should document how to use it properly?
Also, is that cmdlen parameter really needed?

I am willing to contribute with that, but I don't know which type of issue I should open to report an unused param.

Links:
Linked PRs
  • gh-134539

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the print_topics definition at Lib/cmd.py#L346, the Cmd documentation, and its typeshed declaration. Review linked PR gh-134539 and the unresolved questions about cmdlen, naming, and typing before deciding the intended public behavior. Done means the agreed behavior and parameter usage are documented, with the typeshed annotation addressed if needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.