diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-04-28 04:42:55 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-04-28 04:42:55 (GMT) |
commit | b185a04aa10209df7c5fa329696e3c33c38eba7a (patch) | |
tree | 491c503fa4a8b867ca5228af5a3d19f0628c4a6b /Lib/pydoc.py | |
parent | 507cbc17731b33d87159f63fd1c4237a74bb285b (diff) | |
download | cpython-b185a04aa10209df7c5fa329696e3c33c38eba7a.zip cpython-b185a04aa10209df7c5fa329696e3c33c38eba7a.tar.gz cpython-b185a04aa10209df7c5fa329696e3c33c38eba7a.tar.bz2 |
#11926: add missing keywords to help("keywords").
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 36c6a97..8cc1abd 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1538,6 +1538,9 @@ class Helper: # in Doc/ and copying the output file into the Lib/ directory. keywords = { + 'False': '', + 'None': '', + 'True': '', 'and': 'BOOLEAN', 'as': 'with', 'assert': ('assert', ''), @@ -1552,12 +1555,13 @@ class Helper: 'finally': 'try', 'for': ('for', 'break continue while'), 'from': 'import', - 'global': ('global', 'NAMESPACES'), + 'global': ('global', 'nonlocal NAMESPACES'), 'if': ('if', 'TRUTHVALUE'), 'import': ('import', 'MODULES'), 'in': ('in', 'SEQUENCEMETHODS'), 'is': 'COMPARISON', 'lambda': ('lambda', 'FUNCTIONS'), + 'nonlocal': ('nonlocal', 'global NAMESPACES'), 'not': 'BOOLEAN', 'or': 'BOOLEAN', 'pass': ('pass', ''), @@ -1652,7 +1656,7 @@ class Helper: 'NUMBERMETHODS': ('numeric-types', 'NUMBERS AUGMENTEDASSIGNMENT ' 'SPECIALMETHODS'), 'EXECUTION': ('execmodel', 'NAMESPACES DYNAMICFEATURES EXCEPTIONS'), - 'NAMESPACES': ('naming', 'global ASSIGNMENT DELETION DYNAMICFEATURES'), + 'NAMESPACES': ('naming', 'global nonlocal ASSIGNMENT DELETION DYNAMICFEATURES'), 'DYNAMICFEATURES': ('dynamic-features', ''), 'SCOPING': 'NAMESPACES', 'FRAMES': 'NAMESPACES', @@ -1752,6 +1756,9 @@ has the same effect as typing a particular string at the help> prompt. elif request[:8] == 'modules ': self.listmodules(request.split()[1]) elif request in self.symbols: self.showsymbol(request) + elif request in ['True', 'False', 'None']: + # special case these keywords since they are objects too + doc(eval(request), 'Help on %s:') elif request in self.keywords: self.showtopic(request) elif request in self.topics: self.showtopic(request) elif request: doc(request, 'Help on %s:') |