From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 15 May 2026 16:57:59 +0000 (+0200) Subject: [3.15] gh-142349: Add `help("lazy")` support (GH-149886) (#149889) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2F3.15;p=thirdparty%2FPython%2Fcpython.git [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 --- diff --git a/Doc/tools/extensions/pydoc_topics.py b/Doc/tools/extensions/pydoc_topics.py index a65d77433b25..35878e2d1e43 100644 --- a/Doc/tools/extensions/pydoc_topics.py +++ b/Doc/tools/extensions/pydoc_topics.py @@ -68,6 +68,7 @@ _PYDOC_TOPIC_LABELS: Sequence[str] = sorted({ "in", "integers", "lambda", + "lazy", "lists", "naming", "nonlocal", diff --git a/Lib/pydoc.py b/Lib/pydoc.py index a1a6aad434dd..497cc7d90a42 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 2e190d1b81be..5cd26923f75c 100644 --- a/Lib/test/test_pydoc/test_pydoc.py +++ b/Lib/test/test_pydoc/test_pydoc.py @@ -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 index 000000000000..fa667c411094 --- /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`.