We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
match
case
help()
1 parent d43f47b commit f74dbc8Copy full SHA for f74dbc8
4 files changed
Doc/tools/extensions/pydoc_topics.py
@@ -69,6 +69,7 @@
69
"integers",
70
"lambda",
71
"lists",
72
+ "match",
73
"naming",
74
"nonlocal",
75
"numbers",
Lib/pydoc.py
@@ -1832,6 +1832,7 @@ class Helper:
1832
'async': ('async', ''),
1833
'await': ('await', ''),
1834
'break': ('break', 'while for'),
1835
+ 'case': 'match',
1836
'class': ('class', 'CLASSES SPECIALMETHODS'),
1837
'continue': ('continue', 'while for'),
1838
'def': ('function', ''),
@@ -1843,11 +1844,12 @@ class Helper:
1843
1844
'for': ('for', 'break continue while'),
1845
'from': 'import',
1846
'global': ('global', 'nonlocal NAMESPACES'),
- 'if': ('if', 'TRUTHVALUE'),
1847
+ 'if': ('if', 'TRUTHVALUE match'),
1848
'import': ('import', 'MODULES'),
1849
'in': ('in', 'SEQUENCEMETHODS'),
1850
'is': 'COMPARISON',
1851
'lambda': ('lambda', 'FUNCTIONS'),
1852
+ 'match': ('match', 'if'),
1853
'nonlocal': ('nonlocal', 'global NAMESPACES'),
1854
'not': 'BOOLEAN',
1855
'or': 'BOOLEAN',
Lib/test/test_pydoc/test_pydoc.py
@@ -2198,7 +2198,7 @@ def mock_getline(prompt):
2198
2199
def test_keywords(self):
2200
self.assertEqual(sorted(pydoc.Helper.keywords),
2201
- sorted(keyword.kwlist))
+ sorted(keyword.kwlist + ['case', 'match']))
2202
2203
def test_interact_empty_line_continues(self):
2204
# gh-138568: test pressing Enter without input should continue in help session
Misc/NEWS.d/next/Library/2026-06-24-22-16-35.gh-issue-105895.hRkuEw.rst
@@ -0,0 +1,2 @@
1
+Add :keyword:`match` and :keyword:`case` to the list of supported topics by
2
+:func:`help`.
0 commit comments