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
8d603f17
Kaydet (Commit)
8d603f17
authored
Tem 21, 2015
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge 3.5 (Issue #24669)
üst
ad1a3419
e4e811d6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
1 deletion
+8
-1
inspect.py
Lib/inspect.py
+1
-1
inspect_fodder.py
Lib/test/inspect_fodder.py
+3
-0
test_inspect.py
Lib/test/test_inspect.py
+2
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/inspect.py
Dosyayı görüntüle @
8d603f17
...
...
@@ -798,7 +798,7 @@ def findsource(object):
if
not
hasattr
(
object
,
'co_firstlineno'
):
raise
OSError
(
'could not find function definition'
)
lnum
=
object
.
co_firstlineno
-
1
pat
=
re
.
compile
(
r'^(\s*def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)'
)
pat
=
re
.
compile
(
r'^(\s*def\s)|(
\s*async\s+def\s)|(
.*(?<!\w)lambda(:|\s))|^(\s*@)'
)
while
lnum
>
0
:
if
pat
.
match
(
lines
[
lnum
]):
break
lnum
=
lnum
-
1
...
...
Lib/test/inspect_fodder.py
Dosyayı görüntüle @
8d603f17
...
...
@@ -66,3 +66,6 @@ class FesteringGob(MalodorousPervert, ParrotDroppings):
pass
def
contradiction
(
self
):
pass
async
def
lobbest
(
grenade
):
pass
Lib/test/test_inspect.py
Dosyayı görüntüle @
8d603f17
...
...
@@ -336,6 +336,7 @@ class TestRetrievingSourceCode(GetSourceBase):
def
test_getfunctions
(
self
):
functions
=
inspect
.
getmembers
(
mod
,
inspect
.
isfunction
)
self
.
assertEqual
(
functions
,
[(
'eggs'
,
mod
.
eggs
),
(
'lobbest'
,
mod
.
lobbest
),
(
'spam'
,
mod
.
spam
)])
@unittest.skipIf
(
sys
.
flags
.
optimize
>=
2
,
...
...
@@ -393,6 +394,7 @@ class TestRetrievingSourceCode(GetSourceBase):
def
test_getsource
(
self
):
self
.
assertSourceEqual
(
git
.
abuse
,
29
,
39
)
self
.
assertSourceEqual
(
mod
.
StupidGit
,
21
,
50
)
self
.
assertSourceEqual
(
mod
.
lobbest
,
70
,
71
)
def
test_getsourcefile
(
self
):
self
.
assertEqual
(
normcase
(
inspect
.
getsourcefile
(
mod
.
spam
)),
modfile
)
...
...
Misc/NEWS
Dosyayı görüntüle @
8d603f17
...
...
@@ -64,6 +64,8 @@ Library
-
Issue
#
6549
:
Remove
hyphen
from
ttk
.
Style
().
element
options
.
Only
return
result
from
ttk
.
Style
().
configure
if
a
result
was
generated
or
a
query
submitted
.
-
Issue
#
24669
:
Fix
inspect
.
getsource
()
for
'async def'
functions
.
Patch
by
Kai
Groner
.
What
's New in Python 3.5.0 beta 3?
==================================
...
...
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