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
9b887c79
Kaydet (Commit)
9b887c79
authored
Eki 20, 1997
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added tests of dict.get()
üst
320ac331
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
test_types.py
Lib/test/test_types.py
+6
-0
No files found.
Lib/test/test_types.py
Dosyayı görüntüle @
9b887c79
...
...
@@ -189,3 +189,9 @@ d.update({1:1, 2:2, 3:3})
if
d
!=
{
1
:
1
,
2
:
2
,
3
:
3
}:
raise
TestFailed
,
'dict update'
if
d
.
copy
()
!=
{
1
:
1
,
2
:
2
,
3
:
3
}:
raise
TestFailed
,
'dict copy'
if
{}
.
copy
()
!=
{}:
raise
TestFailed
,
'empty dict copy'
# dict.get()
d
=
{
'a'
:
1
,
'b'
:
2
}
if
d
.
get
(
'c'
)
!=
None
:
raise
TestFailed
,
'missing dict get, no 2nd arg'
if
d
.
get
(
'c'
,
3
)
!=
3
:
raise
TestFailed
,
'missing dict get, w/ 2nd arg'
if
d
.
get
(
'a'
)
!=
1
:
raise
TestFailed
,
'present dict get, no 2nd arg'
if
d
.
get
(
'a'
,
3
)
!=
1
:
raise
TestFailed
,
'present dict get, w/ 2nd arg'
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