From 6bfbc97b1f06a9b3f665a87284b64ba8ffb0a3b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Delfino?= Date: Thu, 5 Nov 2026 08:57:16 -0300 Subject: [PATCH 1/3] gh-161414: Remove the backquote from the pydoc symbols Helper.symbols mapped the backquote to the BACKQUOTES topic, which was removed along with Python 2's backquote syntax, so help('`') reported "no documentation found for 'BACKQUOTES'". Co-Authored-By: Claude Opus 5.5 --- Lib/pydoc.py | 1 - Lib/test/test_pydoc/test_pydoc.py | 8 ++++++++ .../2026-11-05-11-59-58.gh-issue-161414.Xnxe8A.rst | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2026-11-05-11-59-58.gh-issue-161414.Xnxe8A.rst diff --git a/Lib/pydoc.py b/Lib/pydoc.py index c0e26efa70e4314..a586d35866b038f 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -2012,7 +2012,6 @@ class Helper: ':=': 'ASSIGNMENTEXPRESSIONS', '_': 'PRIVATENAMES', '__': 'PRIVATENAMES SPECIALMETHODS', - '`': 'BACKQUOTES', '(': 'TUPLES FUNCTIONS CALLS', ')': 'TUPLES FUNCTIONS CALLS', '[': 'LISTS SUBSCRIPTS SLICINGS', diff --git a/Lib/test/test_pydoc/test_pydoc.py b/Lib/test/test_pydoc/test_pydoc.py index 896d961defe09df..a7a5134e2882d07 100644 --- a/Lib/test/test_pydoc/test_pydoc.py +++ b/Lib/test/test_pydoc/test_pydoc.py @@ -2294,6 +2294,14 @@ def test_keywords(self): self.assertEqual(sorted(pydoc.Helper.keywords), sorted(keyword.kwlist + ['case', 'match', 'lazy'])) + def test_symbols(self): + # Every symbol listed by help('symbols') must lead to documentation. + for symbol in pydoc.Helper.symbols: + with self.subTest(symbol=symbol): + buf = StringIO() + pydoc.Helper(output=buf).showsymbol(symbol) + self.assertNotIn('no documentation found', buf.getvalue()) + def test_interact_empty_line_continues(self): # gh-138568: test pressing Enter without input should continue in help session self.assertEqual( diff --git a/Misc/NEWS.d/next/Library/2026-11-05-11-59-58.gh-issue-161414.Xnxe8A.rst b/Misc/NEWS.d/next/Library/2026-11-05-11-59-58.gh-issue-161414.Xnxe8A.rst new file mode 100644 index 000000000000000..83963d65b45f3b9 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-11-05-11-59-58.gh-issue-161414.Xnxe8A.rst @@ -0,0 +1,3 @@ +Remove the backquote from the symbols listed by :func:`help`. It is not +valid syntax in Python 3, and asking for help on it reported that no +documentation was found. From efe87b5fbc31e9046da3c8c01c3b12096bdffdc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Delfino?= Date: Thu, 5 Nov 2026 11:14:44 -0300 Subject: [PATCH 2/3] Update Lib/test/test_pydoc/test_pydoc.py Co-authored-by: sobolevn --- Lib/test/test_pydoc/test_pydoc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_pydoc/test_pydoc.py b/Lib/test/test_pydoc/test_pydoc.py index a7a5134e2882d07..a63530c29058275 100644 --- a/Lib/test/test_pydoc/test_pydoc.py +++ b/Lib/test/test_pydoc/test_pydoc.py @@ -2295,7 +2295,7 @@ def test_keywords(self): sorted(keyword.kwlist + ['case', 'match', 'lazy'])) def test_symbols(self): - # Every symbol listed by help('symbols') must lead to documentation. + # gh-161414 for symbol in pydoc.Helper.symbols: with self.subTest(symbol=symbol): buf = StringIO() From fda6e9445428e1b6e06c96e58c5bfd9c893620e9 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Thu, 5 Nov 2026 17:01:54 +0000 Subject: [PATCH 3/3] Update Misc/NEWS.d/next/Library/2026-11-05-11-59-58.gh-issue-161414.Xnxe8A.rst --- .../Library/2026-11-05-11-59-58.gh-issue-161414.Xnxe8A.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Library/2026-11-05-11-59-58.gh-issue-161414.Xnxe8A.rst b/Misc/NEWS.d/next/Library/2026-11-05-11-59-58.gh-issue-161414.Xnxe8A.rst index 83963d65b45f3b9..7536c5c25a13f5b 100644 --- a/Misc/NEWS.d/next/Library/2026-11-05-11-59-58.gh-issue-161414.Xnxe8A.rst +++ b/Misc/NEWS.d/next/Library/2026-11-05-11-59-58.gh-issue-161414.Xnxe8A.rst @@ -1,3 +1,2 @@ -Remove the backquote from the symbols listed by :func:`help`. It is not -valid syntax in Python 3, and asking for help on it reported that no +Remove the backquote from the symbols listed by :func:`help`, asking for help on it reported that no documentation was found.