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
f229bc5c
Kaydet (Commit)
f229bc5c
authored
May 15, 2015
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
inspect: Remove "0x..." IDs from Signature objects' __repr__
Issue 24200.
üst
51b58325
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
inspect.py
Lib/inspect.py
+3
-6
test_inspect.py
Lib/test/test_inspect.py
+1
-2
No files found.
Lib/inspect.py
Dosyayı görüntüle @
f229bc5c
...
@@ -2346,8 +2346,7 @@ class Parameter:
...
@@ -2346,8 +2346,7 @@ class Parameter:
return
formatted
return
formatted
def
__repr__
(
self
):
def
__repr__
(
self
):
return
'<{} at {:#x} "{}">'
.
format
(
self
.
__class__
.
__name__
,
return
'<{} "{}">'
.
format
(
self
.
__class__
.
__name__
,
self
)
id
(
self
),
self
)
def
__hash__
(
self
):
def
__hash__
(
self
):
return
hash
((
self
.
name
,
self
.
kind
,
self
.
annotation
,
self
.
default
))
return
hash
((
self
.
name
,
self
.
kind
,
self
.
annotation
,
self
.
default
))
...
@@ -2464,8 +2463,7 @@ class BoundArguments:
...
@@ -2464,8 +2463,7 @@ class BoundArguments:
args
=
[]
args
=
[]
for
arg
,
value
in
self
.
arguments
.
items
():
for
arg
,
value
in
self
.
arguments
.
items
():
args
.
append
(
'{}={!r}'
.
format
(
arg
,
value
))
args
.
append
(
'{}={!r}'
.
format
(
arg
,
value
))
return
'<{} at {:#x} ({})>'
.
format
(
self
.
__class__
.
__name__
,
return
'<{} ({})>'
.
format
(
self
.
__class__
.
__name__
,
', '
.
join
(
args
))
id
(
self
),
', '
.
join
(
args
))
class
Signature
:
class
Signature
:
...
@@ -2835,8 +2833,7 @@ class Signature:
...
@@ -2835,8 +2833,7 @@ class Signature:
self
.
_return_annotation
=
state
[
'_return_annotation'
]
self
.
_return_annotation
=
state
[
'_return_annotation'
]
def
__repr__
(
self
):
def
__repr__
(
self
):
return
'<{} at {:#x} "{}">'
.
format
(
self
.
__class__
.
__name__
,
return
'<{} {}>'
.
format
(
self
.
__class__
.
__name__
,
self
)
id
(
self
),
self
)
def
__str__
(
self
):
def
__str__
(
self
):
result
=
[]
result
=
[]
...
...
Lib/test/test_inspect.py
Dosyayı görüntüle @
f229bc5c
...
@@ -3153,8 +3153,7 @@ class TestBoundArguments(unittest.TestCase):
...
@@ -3153,8 +3153,7 @@ class TestBoundArguments(unittest.TestCase):
def
foo
(
a
,
b
,
*
,
c
:
1
=
{},
**
kw
)
->
{
42
:
'ham'
}:
pass
def
foo
(
a
,
b
,
*
,
c
:
1
=
{},
**
kw
)
->
{
42
:
'ham'
}:
pass
sig
=
inspect
.
signature
(
foo
)
sig
=
inspect
.
signature
(
foo
)
ba
=
sig
.
bind
(
20
,
30
,
z
=
{})
ba
=
sig
.
bind
(
20
,
30
,
z
=
{})
self
.
assertRegex
(
repr
(
ba
),
self
.
assertRegex
(
repr
(
ba
),
r'<BoundArguments \(a=20,.*\}\}\)>'
)
r'<BoundArguments at 0x[a-fA-F0-9]+ \(a=20,.*\}\}\)>'
)
class
TestSignaturePrivateHelpers
(
unittest
.
TestCase
):
class
TestSignaturePrivateHelpers
(
unittest
.
TestCase
):
...
...
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