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
351e362d
Kaydet (Commit)
351e362d
authored
Eyl 27, 2001
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
List class attrs in MRO order of defining class instead of by alphabetic
order of defining class's name.
üst
3ffeae13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
23 deletions
+12
-23
pydoc.py
Lib/pydoc.py
+12
-23
No files found.
Lib/pydoc.py
Dosyayı görüntüle @
351e362d
...
@@ -621,7 +621,7 @@ TT { font-family: lucidatypewriter, lucida console, courier }
...
@@ -621,7 +621,7 @@ TT { font-family: lucidatypewriter, lucida console, courier }
hr
=
HorizontalRule
()
hr
=
HorizontalRule
()
# List the mro, if non-trivial.
# List the mro, if non-trivial.
mro
=
inspect
.
getmro
(
object
)
mro
=
list
(
inspect
.
getmro
(
object
)
)
if
len
(
mro
)
>
2
:
if
len
(
mro
)
>
2
:
hr
.
maybe
()
hr
.
maybe
()
push
(
'<dl><dt>Method resolution order:</dt>
\n
'
)
push
(
'<dl><dt>Method resolution order:</dt>
\n
'
)
...
@@ -693,11 +693,11 @@ TT { font-family: lucidatypewriter, lucida console, courier }
...
@@ -693,11 +693,11 @@ TT { font-family: lucidatypewriter, lucida console, courier }
except
TypeError
:
except
TypeError
:
pass
pass
# Sort attrs by name of defining class.
attrs
.
sort
(
lambda
t1
,
t2
:
cmp
(
t1
[
2
]
.
__name__
,
t2
[
2
]
.
__name__
))
thisclass
=
object
# list attrs defined here first
while
attrs
:
while
attrs
:
if
mro
:
thisclass
=
mro
.
pop
(
0
)
else
:
thisclass
=
attrs
[
0
][
2
]
attrs
,
inherited
=
_split_list
(
attrs
,
lambda
t
:
t
[
2
]
is
thisclass
)
attrs
,
inherited
=
_split_list
(
attrs
,
lambda
t
:
t
[
2
]
is
thisclass
)
if
thisclass
is
object
:
if
thisclass
is
object
:
...
@@ -722,12 +722,7 @@ TT { font-family: lucidatypewriter, lucida console, courier }
...
@@ -722,12 +722,7 @@ TT { font-family: lucidatypewriter, lucida console, courier }
attrs
=
spilldata
(
"Data and non-method functions
%
s"
%
tag
,
attrs
,
attrs
=
spilldata
(
"Data and non-method functions
%
s"
%
tag
,
attrs
,
lambda
t
:
t
[
1
]
==
'data'
)
lambda
t
:
t
[
1
]
==
'data'
)
assert
attrs
==
[]
assert
attrs
==
[]
attrs
=
inherited
# Split off the attributes inherited from the next class (note
# that inherited remains sorted by class name).
if
inherited
:
attrs
=
inherited
thisclass
=
attrs
[
0
][
2
]
contents
=
''
.
join
(
contents
)
contents
=
''
.
join
(
contents
)
...
@@ -1008,7 +1003,7 @@ class TextDoc(Doc):
...
@@ -1008,7 +1003,7 @@ class TextDoc(Doc):
push
=
contents
.
append
push
=
contents
.
append
# List the mro, if non-trivial.
# List the mro, if non-trivial.
mro
=
inspect
.
getmro
(
object
)
mro
=
list
(
inspect
.
getmro
(
object
)
)
if
len
(
mro
)
>
2
:
if
len
(
mro
)
>
2
:
push
(
"Method resolution order:"
)
push
(
"Method resolution order:"
)
for
base
in
mro
:
for
base
in
mro
:
...
@@ -1072,12 +1067,11 @@ class TextDoc(Doc):
...
@@ -1072,12 +1067,11 @@ class TextDoc(Doc):
return
attrs
return
attrs
attrs
=
inspect
.
classify_class_attrs
(
object
)
attrs
=
inspect
.
classify_class_attrs
(
object
)
# Sort attrs by name of defining class.
attrs
.
sort
(
lambda
t1
,
t2
:
cmp
(
t1
[
2
]
.
__name__
,
t2
[
2
]
.
__name__
))
thisclass
=
object
# list attrs defined here first
while
attrs
:
while
attrs
:
if
mro
:
thisclass
=
mro
.
pop
(
0
)
else
:
thisclass
=
attrs
[
0
][
2
]
attrs
,
inherited
=
_split_list
(
attrs
,
lambda
t
:
t
[
2
]
is
thisclass
)
attrs
,
inherited
=
_split_list
(
attrs
,
lambda
t
:
t
[
2
]
is
thisclass
)
if
thisclass
is
object
:
if
thisclass
is
object
:
...
@@ -1101,12 +1095,7 @@ class TextDoc(Doc):
...
@@ -1101,12 +1095,7 @@ class TextDoc(Doc):
attrs
=
spilldata
(
"Data and non-method functions
%
s:
\n
"
%
tag
,
attrs
=
spilldata
(
"Data and non-method functions
%
s:
\n
"
%
tag
,
attrs
,
lambda
t
:
t
[
1
]
==
'data'
)
attrs
,
lambda
t
:
t
[
1
]
==
'data'
)
assert
attrs
==
[]
assert
attrs
==
[]
attrs
=
inherited
# Split off the attributes inherited from the next class (note
# that inherited remains sorted by class name).
if
inherited
:
attrs
=
inherited
thisclass
=
attrs
[
0
][
2
]
contents
=
'
\n
'
.
join
(
contents
)
contents
=
'
\n
'
.
join
(
contents
)
if
not
contents
:
if
not
contents
:
...
...
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