Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to

pydoc's help keywords.
This commit is contained in:
Georg Brandl 2007-03-13 10:06:48 +00:00
parent 4ffc8f5107
commit b6a87542b3
2 changed files with 6 additions and 0 deletions

View file

@ -1511,6 +1511,7 @@ def writedocs(dir, pkgpath='', done=None):
class Helper: class Helper:
keywords = { keywords = {
'and': 'BOOLEAN', 'and': 'BOOLEAN',
'as': 'with',
'assert': ('ref/assert', ''), 'assert': ('ref/assert', ''),
'break': ('ref/break', 'while for'), 'break': ('ref/break', 'while for'),
'class': ('ref/class', 'CLASSES SPECIALMETHODS'), 'class': ('ref/class', 'CLASSES SPECIALMETHODS'),
@ -1538,6 +1539,7 @@ class Helper:
'return': ('ref/return', 'FUNCTIONS'), 'return': ('ref/return', 'FUNCTIONS'),
'try': ('ref/try', 'EXCEPTIONS'), 'try': ('ref/try', 'EXCEPTIONS'),
'while': ('ref/while', 'break continue if TRUTHVALUE'), 'while': ('ref/while', 'break continue if TRUTHVALUE'),
'with': ('ref/with', 'CONTEXTMANAGERS EXCEPTIONS yield'),
'yield': ('ref/yield', ''), 'yield': ('ref/yield', ''),
} }
@ -1619,6 +1621,7 @@ class Helper:
'LOOPING': ('ref/compound', 'for while break continue'), 'LOOPING': ('ref/compound', 'for while break continue'),
'TRUTHVALUE': ('lib/truth', 'if while and or not BASICMETHODS'), 'TRUTHVALUE': ('lib/truth', 'if while and or not BASICMETHODS'),
'DEBUGGING': ('lib/module-pdb', 'pdb'), 'DEBUGGING': ('lib/module-pdb', 'pdb'),
'CONTEXTMANAGERS': ('ref/context-managers', 'with'),
} }
def __init__(self, input, output): def __init__(self, input, output):

View file

@ -168,6 +168,9 @@ Core and builtins
Library Library
------- -------
- Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to
pydoc's help keywords.
- Patch #1555098: use str.join() instead of repeated string - Patch #1555098: use str.join() instead of repeated string
concatenation in robotparser. concatenation in robotparser.