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
f9e1f2bd
Kaydet (Commit)
f9e1f2bd
authored
Mar 02, 2016
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
inspect: Fix BoundArguments.apply_defaults to handle empty arguments
Patch by Frederick Wagner (issue #26347)
üst
1bd03078
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
inspect.py
Lib/inspect.py
+0
-2
test_inspect.py
Lib/test/test_inspect.py
+7
-0
No files found.
Lib/inspect.py
Dosyayı görüntüle @
f9e1f2bd
...
...
@@ -2591,8 +2591,6 @@ class BoundArguments:
empty dict.
"""
arguments
=
self
.
arguments
if
not
arguments
:
return
new_arguments
=
[]
for
name
,
param
in
self
.
_signature
.
parameters
.
items
():
try
:
...
...
Lib/test/test_inspect.py
Dosyayı görüntüle @
f9e1f2bd
...
...
@@ -3324,6 +3324,13 @@ class TestBoundArguments(unittest.TestCase):
ba
.
apply_defaults
()
self
.
assertEqual
(
list
(
ba
.
arguments
.
items
()),
[])
# Make sure a no-args binding still acquires proper defaults.
def
foo
(
a
=
'spam'
):
pass
sig
=
inspect
.
signature
(
foo
)
ba
=
sig
.
bind
()
ba
.
apply_defaults
()
self
.
assertEqual
(
list
(
ba
.
arguments
.
items
()),
[(
'a'
,
'spam'
)])
class
TestSignaturePrivateHelpers
(
unittest
.
TestCase
):
def
test_signature_get_bound_param
(
self
):
...
...
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