Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
44aad855
Commit
44aad855
authored
Apr 28, 2011
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Plain Diff
#11926: merge with 3.1.
parents
4f741235
b185a04a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
10 deletions
+23
-10
Lib/pydoc.py
Lib/pydoc.py
+6
-0
Lib/pydoc_data/topics.py
Lib/pydoc_data/topics.py
+10
-10
Lib/test/test_pydoc.py
Lib/test/test_pydoc.py
+7
-0
No files found.
Lib/pydoc.py
View file @
44aad855
...
...
@@ -1576,6 +1576,9 @@ class Helper:
# in Doc/ and copying the output file into the Lib/ directory.
keywords
=
{
'False'
:
''
,
'None'
:
''
,
'True'
:
''
,
'and'
:
'BOOLEAN'
,
'as'
:
'with'
,
'assert'
:
(
'assert'
,
''
),
...
...
@@ -1791,6 +1794,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:'
,
output
=
self
.
_output
)
...
...
Lib/pydoc_data/topics.py
View file @
44aad855
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Lib/test/test_pydoc.py
View file @
44aad855
...
...
@@ -3,6 +3,7 @@ import sys
import
difflib
import
inspect
import
pydoc
import
keyword
import
re
import
string
import
subprocess
...
...
@@ -465,11 +466,17 @@ class PydocUrlHandlerTest(unittest.TestCase):
self
.
assertEqual
(
result
,
title
)
class
TestHelper
(
unittest
.
TestCase
):
def
test_keywords
(
self
):
self
.
assertEqual
(
sorted
(
pydoc
.
Helper
.
keywords
),
sorted
(
keyword
.
kwlist
))
def
test_main
():
test
.
support
.
run_unittest
(
PydocDocTest
,
TestDescriptions
,
PydocServerTest
,
PydocUrlHandlerTest
,
TestHelper
,
)
if
__name__
==
"__main__"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment