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
b539cef3
Kaydet (Commit)
b539cef3
authored
Ara 31, 2018
tarafından
Sanyam Khurana
Kaydeden (comit)
Nick Coghlan
Ara 31, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-35614: Fix pydoc help() on metaclasses (#11357)
üst
1d300ce1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
pydoc.py
Lib/pydoc.py
+1
-1
test_pydoc.py
Lib/test/test_pydoc.py
+11
-0
2018-12-30-01-10-50.bpo-35614.cnkM4f.rst
...S.d/next/Library/2018-12-30-01-10-50.bpo-35614.cnkM4f.rst
+1
-0
No files found.
Lib/pydoc.py
Dosyayı görüntüle @
b539cef3
...
@@ -1255,7 +1255,7 @@ location listed above.
...
@@ -1255,7 +1255,7 @@ location listed above.
# List the built-in subclasses, if any:
# List the built-in subclasses, if any:
subclasses
=
sorted
(
subclasses
=
sorted
(
(
str
(
cls
.
__name__
)
for
cls
in
object
.
__subclasses__
(
)
(
str
(
cls
.
__name__
)
for
cls
in
type
.
__subclasses__
(
object
)
if
not
cls
.
__name__
.
startswith
(
"_"
)
and
cls
.
__module__
==
"builtins"
),
if
not
cls
.
__name__
.
startswith
(
"_"
)
and
cls
.
__module__
==
"builtins"
),
key
=
str
.
lower
key
=
str
.
lower
)
)
...
...
Lib/test/test_pydoc.py
Dosyayı görüntüle @
b539cef3
...
@@ -636,6 +636,17 @@ class PydocDocTest(unittest.TestCase):
...
@@ -636,6 +636,17 @@ class PydocDocTest(unittest.TestCase):
# Testing that the subclasses section does not appear
# Testing that the subclasses section does not appear
self
.
assertNotIn
(
'Built-in subclasses'
,
text
)
self
.
assertNotIn
(
'Built-in subclasses'
,
text
)
def
test_builtin_on_metaclasses
(
self
):
"""Tests help on metaclasses.
When running help() on a metaclasses such as type, it
should not contain any "Built-in subclasses" section.
"""
doc
=
pydoc
.
TextDoc
()
text
=
doc
.
docclass
(
type
)
# Testing that the subclasses section does not appear
self
.
assertNotIn
(
'Built-in subclasses'
,
text
)
@unittest.skipIf
(
sys
.
flags
.
optimize
>=
2
,
@unittest.skipIf
(
sys
.
flags
.
optimize
>=
2
,
'Docstrings are omitted with -O2 and above'
)
'Docstrings are omitted with -O2 and above'
)
@unittest.skipIf
(
hasattr
(
sys
,
'gettrace'
)
and
sys
.
gettrace
(),
@unittest.skipIf
(
hasattr
(
sys
,
'gettrace'
)
and
sys
.
gettrace
(),
...
...
Misc/NEWS.d/next/Library/2018-12-30-01-10-50.bpo-35614.cnkM4f.rst
0 → 100644
Dosyayı görüntüle @
b539cef3
Fixed help() on metaclasses. Patch by Sanyam Khurana.
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