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
9a528306
Kaydet (Commit)
9a528306
authored
Tem 29, 2011
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make “pydoc somebuiltin.somemethod” work (#8887)
üst
271208e2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
8 deletions
+29
-8
pydoc.py
Lib/pydoc.py
+7
-6
test_pydoc.py
Lib/test/test_pydoc.py
+19
-2
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/pydoc.py
Dosyayı görüntüle @
9a528306
...
@@ -1454,13 +1454,14 @@ def locate(path, forceload=0):
...
@@ -1454,13 +1454,14 @@ def locate(path, forceload=0):
else
:
break
else
:
break
if
module
:
if
module
:
object
=
module
object
=
module
for
part
in
parts
[
n
:]:
try
:
object
=
getattr
(
object
,
part
)
except
AttributeError
:
return
None
return
object
else
:
else
:
if
hasattr
(
__builtin__
,
path
):
object
=
__builtin__
return
getattr
(
__builtin__
,
path
)
for
part
in
parts
[
n
:]:
try
:
object
=
getattr
(
object
,
part
)
except
AttributeError
:
return
None
return
object
# --------------------------------------- interactive interpreter interface
# --------------------------------------- interactive interpreter interface
...
...
Lib/test/test_pydoc.py
Dosyayı görüntüle @
9a528306
import
sys
import
os
import
os
import
os.path
import
sys
import
difflib
import
difflib
import
subprocess
import
subprocess
import
__builtin__
import
re
import
re
import
pydoc
import
pydoc
import
inspect
import
inspect
...
@@ -357,6 +357,23 @@ class TestHelper(unittest.TestCase):
...
@@ -357,6 +357,23 @@ class TestHelper(unittest.TestCase):
self
.
assertEqual
(
sorted
(
pydoc
.
Helper
.
keywords
),
self
.
assertEqual
(
sorted
(
pydoc
.
Helper
.
keywords
),
sorted
(
keyword
.
kwlist
))
sorted
(
keyword
.
kwlist
))
def
test_builtin
(
self
):
for
name
in
(
'str'
,
'str.translate'
,
'__builtin__.str'
,
'__builtin__.str.translate'
):
# test low-level function
self
.
assertIsNotNone
(
pydoc
.
locate
(
name
))
# test high-level function
try
:
pydoc
.
render_doc
(
name
)
except
ImportError
:
self
.
fail
(
'finding the doc of {!r} failed'
.
format
(
o
))
for
name
in
(
'not__builtin__'
,
'strrr'
,
'strr.translate'
,
'str.trrrranslate'
,
'__builtin__.strrr'
,
'__builtin__.str.trrranslate'
):
self
.
assertIsNone
(
pydoc
.
locate
(
name
))
self
.
assertRaises
(
ImportError
,
pydoc
.
render_doc
,
name
)
def
test_main
():
def
test_main
():
test
.
test_support
.
run_unittest
(
PyDocDocTest
,
test
.
test_support
.
run_unittest
(
PyDocDocTest
,
...
...
Misc/NEWS
Dosyayı görüntüle @
9a528306
...
@@ -37,6 +37,9 @@ Core and Builtins
...
@@ -37,6 +37,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #8887: "pydoc somebuiltin.somemethod" (or help('
somebuiltin
.
somemethod
')
in Python code) now finds the doc of the method.
- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
- Issue #12514: Use try/finally to assure the timeit module restores garbage
- Issue #12514: Use try/finally to assure the timeit module restores garbage
...
...
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