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
ac4bdcc8
Kaydet (Commit)
ac4bdcc8
authored
Eki 29, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #25503: Fixed inspect.getdoc() for inherited docstrings of properties.
Original patch by John Mark Vandenberg.
üst
f8152c67
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
9 deletions
+19
-9
inspect.py
Lib/inspect.py
+7
-6
inspect_fodder.py
Lib/test/inspect_fodder.py
+6
-1
test_inspect.py
Lib/test/test_inspect.py
+2
-2
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/inspect.py
Dosyayı görüntüle @
ac4bdcc8
...
...
@@ -527,17 +527,18 @@ def _finddoc(obj):
cls
=
self
else
:
cls
=
self
.
__class__
elif
ismethoddescriptor
(
obj
)
or
isdatadescriptor
(
obj
):
name
=
obj
.
__name__
cls
=
obj
.
__objclass__
if
getattr
(
cls
,
name
)
is
not
obj
:
return
None
# Should be tested before isdatadescriptor().
elif
isinstance
(
obj
,
property
):
func
=
f
.
fget
func
=
obj
.
fget
name
=
func
.
__name__
cls
=
_findclass
(
func
)
if
cls
is
None
or
getattr
(
cls
,
name
)
is
not
obj
:
return
None
elif
ismethoddescriptor
(
obj
)
or
isdatadescriptor
(
obj
):
name
=
obj
.
__name__
cls
=
obj
.
__objclass__
if
getattr
(
cls
,
name
)
is
not
obj
:
return
None
else
:
return
None
...
...
Lib/test/inspect_fodder.py
Dosyayı görüntüle @
ac4bdcc8
...
...
@@ -45,14 +45,17 @@ class StupidGit:
self
.
ex
=
sys
.
exc_info
()
self
.
tr
=
inspect
.
trace
()
@property
def
contradiction
(
self
):
'The automatic gainsaying.'
pass
# line
48
# line
53
class
MalodorousPervert
(
StupidGit
):
def
abuse
(
self
,
a
,
b
,
c
):
pass
@property
def
contradiction
(
self
):
pass
...
...
@@ -64,6 +67,8 @@ class ParrotDroppings:
class
FesteringGob
(
MalodorousPervert
,
ParrotDroppings
):
def
abuse
(
self
,
a
,
b
,
c
):
pass
@property
def
contradiction
(
self
):
pass
...
...
Lib/test/test_inspect.py
Dosyayı görüntüle @
ac4bdcc8
...
...
@@ -393,8 +393,8 @@ class TestRetrievingSourceCode(GetSourceBase):
def
test_getsource
(
self
):
self
.
assertSourceEqual
(
git
.
abuse
,
29
,
39
)
self
.
assertSourceEqual
(
mod
.
StupidGit
,
21
,
5
0
)
self
.
assertSourceEqual
(
mod
.
lobbest
,
7
0
,
71
)
self
.
assertSourceEqual
(
mod
.
StupidGit
,
21
,
5
1
)
self
.
assertSourceEqual
(
mod
.
lobbest
,
7
5
,
76
)
def
test_getsourcefile
(
self
):
self
.
assertEqual
(
normcase
(
inspect
.
getsourcefile
(
mod
.
spam
)),
modfile
)
...
...
Misc/ACKS
Dosyayı görüntüle @
ac4bdcc8
...
...
@@ -1480,6 +1480,7 @@ Lukas Vacek
Ville Vainio
Andi Vajda
Case Van Horsen
John Mark Vandenberg
Kyle VanderBeek
Andrew Vant
Atul Varma
...
...
Misc/NEWS
Dosyayı görüntüle @
ac4bdcc8
...
...
@@ -45,6 +45,9 @@ Core and Builtins
Library
-------
-
Issue
#
25503
:
Fixed
inspect
.
getdoc
()
for
inherited
docstrings
of
properties
.
Original
patch
by
John
Mark
Vandenberg
.
-
Issue
#
21827
:
Fixed
textwrap
.
dedent
()
for
the
case
when
largest
common
whitespace
is
a
substring
of
smallest
leading
whitespace
.
Based
on
patch
by
Robert
Li
.
...
...
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