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
c3e1e902
Kaydet (Commit)
c3e1e902
authored
Haz 07, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
don't remove self from example code in the HTML output (closes #13223)
Patch by Víctor Terrón.
üst
4547d371
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
2 deletions
+64
-2
pydoc.py
Lib/pydoc.py
+7
-2
pydoc_mod.py
Lib/test/pydoc_mod.py
+10
-0
test_pydoc.py
Lib/test/test_pydoc.py
+44
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/pydoc.py
Dosyayı görüntüle @
c3e1e902
...
...
@@ -581,10 +581,15 @@ class HTMLDoc(Doc):
elif
pep
:
url
=
'http://www.python.org/dev/peps/pep-
%04
d/'
%
int
(
pep
)
results
.
append
(
'<a href="
%
s">
%
s</a>'
%
(
url
,
escape
(
all
)))
elif
selfdot
:
# Create a link for methods like 'self.method(...)'
# and use <strong> for attributes like 'self.attr'
if
text
[
end
:
end
+
1
]
==
'('
:
results
.
append
(
'self.'
+
self
.
namelink
(
name
,
methods
))
else
:
results
.
append
(
'self.<strong>
%
s</strong>'
%
name
)
elif
text
[
end
:
end
+
1
]
==
'('
:
results
.
append
(
self
.
namelink
(
name
,
methods
,
funcs
,
classes
))
elif
selfdot
:
results
.
append
(
'self.<strong>
%
s</strong>'
%
name
)
else
:
results
.
append
(
self
.
namelink
(
name
,
classes
))
here
=
end
...
...
Lib/test/pydoc_mod.py
Dosyayı görüntüle @
c3e1e902
...
...
@@ -15,6 +15,16 @@ class B(object):
NO_MEANING
=
"eggs"
pass
class
C
(
object
):
def
say_no
(
self
):
return
"no"
def
get_answer
(
self
):
""" Return say_no() """
return
self
.
say_no
()
def
is_it_true
(
self
):
""" Return self.get_answer() """
return
self
.
get_answer
()
def
doc_func
():
"""
This function solves all of the world's problems:
...
...
Lib/test/test_pydoc.py
Dosyayı görüntüle @
c3e1e902
...
...
@@ -38,6 +38,7 @@ FILE
CLASSES
__builtin__.object
B
C
A
\x20\x20\x20\x20
class A
...
...
@@ -59,6 +60,26 @@ CLASSES
| Data and other attributes defined here:
|
\x20\x20
| NO_MEANING = 'eggs'
\x20\x20\x20\x20
class C(__builtin__.object)
| Methods defined here:
|
\x20\x20
| get_answer(self)
| Return say_no()
|
\x20\x20
| is_it_true(self)
| Return self.get_answer()
|
\x20\x20
| say_no(self)
|
\x20\x20
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
\x20\x20
| __dict__
| dictionary for instance variables (if defined)
|
\x20\x20
| __weakref__
| list of weak references to the object (if defined)
FUNCTIONS
doc_func()
...
...
@@ -108,6 +129,7 @@ expected_html_pattern = \
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#B">B</a>
</font></dt><dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#C">C</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#A">A</a>
...
...
@@ -142,6 +164,28 @@ expected_html_pattern = \
Data and other attributes defined here:<br>
<dl><dt><strong>NO_MEANING</strong> = 'eggs'</dl>
</td></tr></table> <p>
<table width="100
%%
" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="C">class <strong>C</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
\x20\x20\x20\x20
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100
%%
">Methods defined here:<br>
<dl><dt><a name="C-get_answer"><strong>get_answer</strong></a>(self)</dt><dd><tt>Return <a href="#C-say_no">say_no</a>()</tt></dd></dl>
<dl><dt><a name="C-is_it_true"><strong>is_it_true</strong></a>(self)</dt><dd><tt>Return self.<a href="#C-get_answer">get_answer</a>()</tt></dd></dl>
<dl><dt><a name="C-say_no"><strong>say_no</strong></a>(self)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100
%%
" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
...
...
Misc/NEWS
Dosyayı görüntüle @
c3e1e902
...
...
@@ -28,6 +28,9 @@ Library
- Issue #21304: Backport the key derivation function hashlib.pbkdf2_hmac from
Python 3 per PEP 466.
- Issue #13223: Fix pydoc.writedoc so that the HTML documentation for methods
that use '
self
' in the example code is generated correctly.
- Issue #21552: Fixed possible integer overflow of too long string lengths in
the tkinter module on 64-bit platforms.
...
...
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