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
c473f8ce
Kaydet (Commit)
c473f8ce
authored
Tem 29, 2011
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge fix for #8887 from 3.2
üst
947fed42
e64e51bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
6 deletions
+28
-6
pydoc.py
Lib/pydoc.py
+7
-6
test_pydoc.py
Lib/test/test_pydoc.py
+18
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/pydoc.py
Dosyayı görüntüle @
c473f8ce
...
...
@@ -1479,13 +1479,14 @@ def locate(path, forceload=0):
else
:
break
if
module
:
object
=
module
for
part
in
parts
[
n
:]:
try
:
object
=
getattr
(
object
,
part
)
except
AttributeError
:
return
None
return
object
else
:
if
hasattr
(
builtins
,
path
):
return
getattr
(
builtins
,
path
)
object
=
builtins
for
part
in
parts
[
n
:]:
try
:
object
=
getattr
(
object
,
part
)
except
AttributeError
:
return
None
return
object
# --------------------------------------- interactive interpreter interface
...
...
Lib/test/test_pydoc.py
Dosyayı görüntüle @
c473f8ce
import
os
import
sys
import
builtins
import
difflib
import
inspect
import
pydoc
...
...
@@ -425,6 +426,23 @@ class TestDescriptions(unittest.TestCase):
expected
=
'C in module
%
s object'
%
__name__
self
.
assertIn
(
expected
,
pydoc
.
render_doc
(
c
))
def
test_builtin
(
self
):
for
name
in
(
'str'
,
'str.translate'
,
'builtins.str'
,
'builtins.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
(
'notbuiltins'
,
'strrr'
,
'strr.translate'
,
'str.trrrranslate'
,
'builtins.strrr'
,
'builtins.str.trrranslate'
):
self
.
assertIsNone
(
pydoc
.
locate
(
name
))
self
.
assertRaises
(
ImportError
,
pydoc
.
render_doc
,
name
)
@unittest.skipUnless
(
threading
,
'Threading required for this test.'
)
class
PydocServerTest
(
unittest
.
TestCase
):
...
...
Misc/NEWS
Dosyayı görüntüle @
c473f8ce
...
...
@@ -244,6 +244,9 @@ Core and Builtins
Library
-------
- Issue #8887: "pydoc somebuiltin.somemethod" (or help('
somebuiltin
.
somemethod
')
in Python code) now finds the doc of the method.
- Issue #10968: Remove indirection in threading. The public names (Thread,
Condition, etc.) used to be factory functions returning instances of hidden
classes (_Thread, _Condition, etc.), because (if Guido recalls correctly) this
...
...
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