Skip to content

bpo-18387: Add 'symbols' link to pydoc's html menu bar#13225

Open
CuriousLearner wants to merge 3 commits intopython:mainfrom
CuriousLearner:fix-Issue18387
Open

bpo-18387: Add 'symbols' link to pydoc's html menu bar#13225
CuriousLearner wants to merge 3 commits intopython:mainfrom
CuriousLearner:fix-Issue18387

Conversation

@CuriousLearner
Copy link
Copy Markdown
Member

@CuriousLearner CuriousLearner commented May 9, 2019

Copy link
Copy Markdown
Contributor

@ZackerySpytz ZackerySpytz left a comment

Choose a reason for hiding this comment

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

There are several CI failures.

When creating a PR based on someone else's patch, the developer's guide states that the "Co-authored-by" syntax should be used in the commit message to attribute the original patch author.

self.maxdict = 10
self.maxstring = self.maxother = 100

def escape(self, text):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems that removing this method causes a failure in test_cgitb.

Lib/pydoc.py Outdated

heading = html.heading(
'<big><big><strong>INDEX</strong></big></big>',
'<big><big><strong>%s</strong></big></big>' % title.upper(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think an f-string should be used here.

Lib/pydoc.py Outdated
title = 'SYMBOL'
contents, xrefs = htmlhelp._getsymbol(topic)
else:
raise ValueError('could not find topic %s' % repr(topic))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think an f-string should be used here.

Lib/pydoc.py Outdated

def bltinlink(name):
return '<a href="topic?key=%s">%s</a>' % (name, name)
return '<a href="topic?key=%s">%s</a>' % (html_escape(name), html_escape(name))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PEP 8 states that lines should be limited to 79 chars.

@csabella
Copy link
Copy Markdown
Contributor

csabella commented Dec 1, 2019

@CuriousLearner, please address the code reviews. Thanks!

- Added 'symbols' navigation link alongside 'topics' and 'keywords'
- Refactored html_topicindex() to handle topics, keywords, and symbols
- Added _getsymbol() method to Helper class for symbol lookup
- Restored escape() method in HTMLRepr and HTMLDoc classes
- Updated test suite to include symbols link verification
- Modernized string formatting using f-strings

Original patch by Ron Adam.

Co-authored-by: Ron Adam <[email protected]>
@CuriousLearner CuriousLearner marked this pull request as ready for review November 14, 2025 02:48
Copy link
Copy Markdown

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

looks better

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 1, 2026

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

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Feb 1, 2026
@CuriousLearner CuriousLearner requested review from ZackerySpytz, csabella and ncoghlan and removed request for ZackerySpytz March 28, 2026 21:17
@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Mar 29, 2026
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.

8 participants