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
28393828
Kaydet (Commit)
28393828
authored
Mar 09, 2012
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #14205: Fix test_dict.test_mutating_lookup()
üst
3774977d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
test_dict.py
Lib/test/test_dict.py
+16
-9
No files found.
Lib/test/test_dict.py
Dosyayı görüntüle @
28393828
...
...
@@ -392,20 +392,27 @@ class DictTest(unittest.TestCase):
class
NastyKey
:
mutate_dict
=
None
def
__init__
(
self
,
value
):
self
.
value
=
value
def
__hash__
(
self
):
# hash collision!
return
1
def
__eq__
(
self
,
other
):
if
self
.
mutate_dict
:
self
.
mutate_dict
[
self
]
=
1
return
self
==
other
d
=
{}
d
[
NastyKey
()]
=
0
NastyKey
.
mutate_dict
=
d
with
self
.
assertRaises
(
RuntimeError
):
d
[
NastyKey
()]
=
None
if
NastyKey
.
mutate_dict
:
mydict
,
key
=
NastyKey
.
mutate_dict
NastyKey
.
mutate_dict
=
None
del
mydict
[
key
]
return
self
.
value
==
other
.
value
key1
=
NastyKey
(
1
)
key2
=
NastyKey
(
2
)
d
=
{
key1
:
1
}
NastyKey
.
mutate_dict
=
(
d
,
key1
)
with
self
.
assertRaisesRegex
(
RuntimeError
,
'dictionary changed size during lookup'
):
d
[
key2
]
=
2
def
test_repr
(
self
):
d
=
{}
...
...
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