]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] gh-142349: Add `help("lazy")` support (GH-149886) (#149889) 3.15
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 15 May 2026 16:57:59 +0000 (18:57 +0200)
committerGitHub <noreply@github.com>
Fri, 15 May 2026 16:57:59 +0000 (16:57 +0000)
gh-142349: Add `help("lazy")` support (GH-149886)
(cherry picked from commit 8be3fb1b50ce6b01bf0924f0a0362a5e04af83b4)

Co-authored-by: sobolevn <mail@sobolevn.me>
Doc/tools/extensions/pydoc_topics.py
Lib/pydoc.py
Lib/test/test_pydoc/test_pydoc.py
Misc/NEWS.d/next/Library/2026-05-15-18-44-20.gh-issue-142349.fHK3v1.rst [new file with mode: 0644]

index a65d77433b255bc5b3a99d1669e6bf1fa4d3d57c..35878e2d1e43e9baf5cfa839b1d5ebbe9a8fc6d6 100644 (file)
@@ -68,6 +68,7 @@ _PYDOC_TOPIC_LABELS: Sequence[str] = sorted({
     "in",
     "integers",
     "lambda",
+    "lazy",
     "lists",
     "naming",
     "nonlocal",
index a1a6aad434ddf4dedd020d00c8b19a512b8bf3e9..497cc7d90a42456d1d3dbe5f58d03e809aed62a9 100644 (file)
@@ -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',
index 2e190d1b81be8ec13f44a3e3830798279219bca9..5cd26923f75c311e0fda2493d428a0aebcb5d71e 100644 (file)
@@ -2172,7 +2172,7 @@ class TestHelper(unittest.TestCase):
 
     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 (file)
index 0000000..fa667c4
--- /dev/null
@@ -0,0 +1 @@
+Add :keyword:`lazy` to the list of support topic by :func:`help`.