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
f2dae0e1
Kaydet (Commit)
f2dae0e1
authored
Ock 21, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#1715: include sub-extension modules in pydoc text output.
üst
dd76e05d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
pydoc.py
Lib/pydoc.py
+13
-1
pydocfodder.py
Lib/test/pydocfodder.py
+6
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/pydoc.py
Dosyayı görüntüle @
f2dae0e1
...
...
@@ -1051,9 +1051,11 @@ class TextDoc(Doc):
if
visiblename
(
key
,
all
):
data
.
append
((
key
,
value
))
modpkgs
=
[]
modpkgs_names
=
set
()
if
hasattr
(
object
,
'__path__'
):
modpkgs
=
[]
for
importer
,
modname
,
ispkg
in
pkgutil
.
iter_modules
(
object
.
__path__
):
modpkgs_names
.
add
(
modname
)
if
ispkg
:
modpkgs
.
append
(
modname
+
' (package)'
)
else
:
...
...
@@ -1063,6 +1065,16 @@ class TextDoc(Doc):
result
=
result
+
self
.
section
(
'PACKAGE CONTENTS'
,
join
(
modpkgs
,
'
\n
'
))
# Detect submodules as sometimes created by C extensions
submodules
=
[]
for
key
,
value
in
inspect
.
getmembers
(
object
,
inspect
.
ismodule
):
if
value
.
__name__
.
startswith
(
name
+
'.'
)
and
key
not
in
modpkgs_names
:
submodules
.
append
(
key
)
if
submodules
:
submodules
.
sort
()
result
=
result
+
self
.
section
(
'SUBMODULES'
,
join
(
submodules
,
'
\n
'
))
if
classes
:
classlist
=
map
(
lambda
(
key
,
value
):
value
,
classes
)
contents
=
[
self
.
formattree
(
...
...
Lib/test/pydocfodder.py
Dosyayı görüntüle @
f2dae0e1
"""Something just to look at via pydoc."""
import
types
class
A_classic
:
"A classic class."
def
A_method
(
self
):
...
...
@@ -208,3 +210,7 @@ class FunkyProperties(object):
del
inst
.
desc
[
self
.
attr
]
x
=
property
(
get_desc
(
'x'
),
set_desc
(
'x'
),
del_desc
(
'x'
),
'prop x'
)
submodule
=
types
.
ModuleType
(
__name__
+
'.submodule'
,
"""A submodule, which should appear in its parent's summary"""
)
Misc/NEWS
Dosyayı görüntüle @
f2dae0e1
...
...
@@ -372,6 +372,8 @@ Core and builtins
Library
-------
- #1715: include sub-extension modules in pydoc'
s
text
output
.
-
#
1836
:
fix
an
off
-
by
-
one
bug
in
TimedRotatingHandler
's rollover
time calculation.
...
...
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