summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-03-13 10:07:01 (GMT)
committerGeorg Brandl <georg@python.org>2007-03-13 10:07:01 (GMT)
commit6cdcdbcdaad14351d392888403419f5a3204b1a3 (patch)
treef2d843c17e15bfc7e907ebd6091709b6bfd70994
parent0a24d105244c39aeaa67db51d0b38e48402d252d (diff)
downloadcpython-6cdcdbcdaad14351d392888403419f5a3204b1a3.zip
cpython-6cdcdbcdaad14351d392888403419f5a3204b1a3.tar.gz
cpython-6cdcdbcdaad14351d392888403419f5a3204b1a3.tar.bz2
Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to
pydoc's help keywords. (backport from rev. 54329)
-rwxr-xr-xLib/pydoc.py3
-rw-r--r--Misc/NEWS3
2 files changed, 6 insertions, 0 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index ce97517..0a24dc1 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1504,6 +1504,7 @@ def writedocs(dir, pkgpath='', done=None):
class Helper:
keywords = {
'and': 'BOOLEAN',
+ 'as': 'with',
'assert': ('ref/assert', ''),
'break': ('ref/break', 'while for'),
'class': ('ref/class', 'CLASSES SPECIALMETHODS'),
@@ -1531,6 +1532,7 @@ class Helper:
'return': ('ref/return', 'FUNCTIONS'),
'try': ('ref/try', 'EXCEPTIONS'),
'while': ('ref/while', 'break continue if TRUTHVALUE'),
+ 'with': ('ref/with', 'CONTEXTMANAGERS EXCEPTIONS yield'),
'yield': ('ref/yield', ''),
}
@@ -1612,6 +1614,7 @@ class Helper:
'LOOPING': ('ref/compound', 'for while break continue'),
'TRUTHVALUE': ('lib/truth', 'if while and or not BASICMETHODS'),
'DEBUGGING': ('lib/module-pdb', 'pdb'),
+ 'CONTEXTMANAGERS': ('ref/context-managers', 'with'),
}
def __init__(self, input, output):
diff --git a/Misc/NEWS b/Misc/NEWS
index 966b9a7..b993ad8 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -202,6 +202,9 @@ Extension Modules
Library
-------
+- Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to
+ pydoc's help keywords.
+
- Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap
the IndexError caused by passing in an invalid breakpoint number.