summaryrefslogtreecommitdiff
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-03-13 10:06:48 +0000
committerGeorg Brandl <georg@python.org>2007-03-13 10:06:48 +0000
commitb6a87542b301e54872807940f71c06be9f03f990 (patch)
treef0d592601e7d7385281a897993a7cc81905d8410 /Lib/pydoc.py
parent4ffc8f51071339cfcb2c0c6f8a47f40340dc60f6 (diff)
downloadcpython-git-b6a87542b301e54872807940f71c06be9f03f990.tar.gz
Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to
pydoc's help keywords.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index bf4400f6d2..8435175d5e 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1511,6 +1511,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'),
@@ -1538,6 +1539,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', ''),
}
@@ -1619,6 +1621,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):