]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to
authorGeorg Brandl <georg@python.org>
Tue, 13 Mar 2007 10:06:48 +0000 (10:06 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 13 Mar 2007 10:06:48 +0000 (10:06 +0000)
pydoc's help keywords.

Lib/pydoc.py
Misc/NEWS

index bf4400f6d24ccb0ab87ec574e8e603a0a4a99568..8435175d5e04d88bd8e6e1ea619771552c10df6d 100755 (executable)
@@ -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):
index 007497db52da7bd760b33a066f47a22c21826442..605d9b5d5cf1534221e1d2a486dcce1163dfff63 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -168,6 +168,9 @@ Core and builtins
 Library
 -------
 
+- Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to
+  pydoc's help keywords.
+
 - Patch #1555098: use str.join() instead of repeated string
   concatenation in robotparser.