Skip to content

gh-161415: Remove nonexistent related help topics in pydoc - #161417

Open
andresdelfino wants to merge 4 commits into
python:mainfrom
andresdelfino:gh-161415-pydoc-related-topics
Open

andresdelfino wants to merge 4 commits into
python:mainfrom
andresdelfino:gh-161415-pydoc-related-topics

Conversation

@andresdelfino

@andresdelfino andresdelfino commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

help('TYPES') listed FILES and help('UNICODE') listed unicode under "Related help topics", but help() finds no entry for either. The FILES topic was removed from Helper.topics in 3.4 (gh-63118) while the cross-reference from TYPES was kept, and unicode is the Python 2 built-in type. This removes both.

The new test runs help() on every related topic listed by the help() topics and keywords, and on the target of every alias entry (such as 'PACKAGES': 'import'), and checks that none of them prints "No help entry found". Without the fix it fails for exactly these two entries.

🤖 Generated with Claude Code

The TYPES topic listed FILES, which was removed from Helper.topics in
Python 3.4, and the UNICODE topic listed unicode, the Python 2 built-in
type. help() finds no entry for either of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread Lib/test/test_pydoc/test_pydoc.py Resolved
Comment thread Lib/test/test_pydoc/test_pydoc.py Outdated
for name, target in (*pydoc.Helper.topics.items(),
*pydoc.Helper.keywords.items()):
if not isinstance(target, tuple):
continue

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why we ignore non-tuple items? maybe we can just make one instead? target = ('', target)

this way we can also check things like 'PACKAGES': 'import',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! I'll apply your suggestion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants