https://github.com/python/cpython/commit/6136ad68010756edfc4474ad24793e62e1b9907e
commit: 6136ad68010756edfc4474ad24793e62e1b9907e
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: sobolevn <[email protected]>
date: 2026-05-15T16:57:59Z
summary:

[3.15] gh-142349: Add `help("lazy")` support (GH-149886) (#149889)

gh-142349: Add `help("lazy")` support (GH-149886)
(cherry picked from commit 8be3fb1b50ce6b01bf0924f0a0362a5e04af83b4)

Co-authored-by: sobolevn <[email protected]>

files:
A Misc/NEWS.d/next/Library/2026-05-15-18-44-20.gh-issue-142349.fHK3v1.rst
M Doc/tools/extensions/pydoc_topics.py
M Lib/pydoc.py
M Lib/test/test_pydoc/test_pydoc.py

diff --git a/Doc/tools/extensions/pydoc_topics.py 
b/Doc/tools/extensions/pydoc_topics.py
index a65d77433b255b..35878e2d1e43e9 100644
--- a/Doc/tools/extensions/pydoc_topics.py
+++ b/Doc/tools/extensions/pydoc_topics.py
@@ -68,6 +68,7 @@
     "in",
     "integers",
     "lambda",
+    "lazy",
     "lists",
     "naming",
     "nonlocal",
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index a1a6aad434ddf4..497cc7d90a4245 100644
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1845,6 +1845,7 @@ class Helper:
         'in': ('in', 'SEQUENCEMETHODS'),
         'is': 'COMPARISON',
         'lambda': ('lambda', 'FUNCTIONS'),
+        'lazy': ('lazy', 'MODULES'),
         'nonlocal': ('nonlocal', 'global NAMESPACES'),
         'not': 'BOOLEAN',
         'or': 'BOOLEAN',
diff --git a/Lib/test/test_pydoc/test_pydoc.py 
b/Lib/test/test_pydoc/test_pydoc.py
index 2e190d1b81be8e..5cd26923f75c31 100644
--- a/Lib/test/test_pydoc/test_pydoc.py
+++ b/Lib/test/test_pydoc/test_pydoc.py
@@ -2172,7 +2172,7 @@ def mock_getline(prompt):
 
     def test_keywords(self):
         self.assertEqual(sorted(pydoc.Helper.keywords),
-                         sorted(keyword.kwlist))
+                         sorted(keyword.kwlist + ['lazy']))
 
     def test_interact_empty_line_continues(self):
         # gh-138568: test pressing Enter without input should continue in help 
session
diff --git 
a/Misc/NEWS.d/next/Library/2026-05-15-18-44-20.gh-issue-142349.fHK3v1.rst 
b/Misc/NEWS.d/next/Library/2026-05-15-18-44-20.gh-issue-142349.fHK3v1.rst
new file mode 100644
index 00000000000000..fa667c4110941e
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2026-05-15-18-44-20.gh-issue-142349.fHK3v1.rst
@@ -0,0 +1 @@
+Add :keyword:`lazy` to the list of support topic by :func:`help`.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to