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
8a387219
Unverified
Kaydet (Commit)
8a387219
authored
Mar 06, 2018
tarafından
Yury Selivanov
Kaydeden (comit)
GitHub
Mar 06, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004)
üst
5d926471
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
inspect.py
Lib/inspect.py
+2
-1
test_inspect.py
Lib/test/test_inspect.py
+10
-0
2018-03-06-11-54-59.bpo-33009.-Ekysb.rst
...S.d/next/Library/2018-03-06-11-54-59.bpo-33009.-Ekysb.rst
+1
-0
No files found.
Lib/inspect.py
Dosyayı görüntüle @
8a387219
...
@@ -2254,7 +2254,8 @@ def _signature_from_callable(obj, *,
...
@@ -2254,7 +2254,8 @@ def _signature_from_callable(obj, *,
return
sig
return
sig
else
:
else
:
sig_params
=
tuple
(
sig
.
parameters
.
values
())
sig_params
=
tuple
(
sig
.
parameters
.
values
())
assert
first_wrapped_param
is
not
sig_params
[
0
]
assert
(
not
sig_params
or
first_wrapped_param
is
not
sig_params
[
0
])
new_params
=
(
first_wrapped_param
,)
+
sig_params
new_params
=
(
first_wrapped_param
,)
+
sig_params
return
sig
.
replace
(
parameters
=
new_params
)
return
sig
.
replace
(
parameters
=
new_params
)
...
...
Lib/test/test_inspect.py
Dosyayı görüntüle @
8a387219
...
@@ -2580,6 +2580,16 @@ class TestSignatureObject(unittest.TestCase):
...
@@ -2580,6 +2580,16 @@ class TestSignatureObject(unittest.TestCase):
(
'c'
,
1
,
...
,
'keyword_only'
)),
(
'c'
,
1
,
...
,
'keyword_only'
)),
'spam'
))
'spam'
))
class
Spam
:
def
test
(
self
:
'anno'
,
x
):
pass
g
=
partialmethod
(
test
,
1
)
self
.
assertEqual
(
self
.
signature
(
Spam
.
g
),
(((
'self'
,
...
,
'anno'
,
'positional_or_keyword'
),),
...
))
def
test_signature_on_fake_partialmethod
(
self
):
def
test_signature_on_fake_partialmethod
(
self
):
def
foo
(
a
):
pass
def
foo
(
a
):
pass
foo
.
_partialmethod
=
'spam'
foo
.
_partialmethod
=
'spam'
...
...
Misc/NEWS.d/next/Library/2018-03-06-11-54-59.bpo-33009.-Ekysb.rst
0 → 100644
Dosyayı görüntüle @
8a387219
Fix inspect.signature() for single-parameter partialmethods.
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