Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
b185a04a
Kaydet (Commit)
b185a04a
authored
Nis 28, 2011
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#11926: add missing keywords to help("keywords").
üst
507cbc17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
pydoc.py
Lib/pydoc.py
+9
-2
topics.py
Lib/pydoc_data/topics.py
+0
-0
test_pydoc.py
Lib/test/test_pydoc.py
+7
-1
No files found.
Lib/pydoc.py
Dosyayı görüntüle @
b185a04a
...
...
@@ -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:'
)
...
...
Lib/pydoc_data/topics.py
Dosyayı görüntüle @
b185a04a
This diff is collapsed.
Click to expand it.
Lib/test/test_pydoc.py
Dosyayı görüntüle @
b185a04a
...
...
@@ -6,6 +6,7 @@ import subprocess
import
re
import
pydoc
import
inspect
import
keyword
import
unittest
import
test.support
import
xml.etree
...
...
@@ -344,8 +345,13 @@ class TestDescriptions(unittest.TestCase):
self
.
assertTrue
(
expected
in
pydoc
.
render_doc
(
c
))
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
)
test
.
support
.
run_unittest
(
PyDocDocTest
,
TestDescriptions
,
TestHelper
)
if
__name__
==
"__main__"
:
test_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