]> granicus.if.org Git - python/commitdiff
Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to
authorGeorg Brandl <georg@python.org>
Tue, 13 Mar 2007 10:07:01 +0000 (10:07 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 13 Mar 2007 10:07:01 +0000 (10:07 +0000)
pydoc's help keywords.
 (backport from rev. 54329)

Lib/pydoc.py
Misc/NEWS

index ce9751787b8fcb2452a33197a59041fd4a27f592..0a24dc1b1095efdf014836b45d54845d3e717ca4 100755 (executable)
@@ -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):
index 966b9a7133395b826e11fcf35a7cd62f6cec1a17..b993ad89ea8b76b67776075ab7d3355791e3ec84 100644 (file)
--- 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.