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
762c1cb3
Kaydet (Commit)
762c1cb3
authored
Agu 31, 2000
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Test case to exercise fix for error propogation bug in dictionarys.
üst
65faf118
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
test_operations
Lib/test/output/test_operations
+4
-1
test_operations.py
Lib/test/test_operations.py
+24
-1
No files found.
Lib/test/output/test_operations
Dosyayı görüntüle @
762c1cb3
test_operations
test_operations
3. Operations
3. Operations
XXX Not yet implemented
XXX Mostly not yet implemented
3.1 Dictionary lookups succeed even if __cmp__() raises an exception
raising error
No exception passed through.
Lib/test/test_operations.py
Dosyayı görüntüle @
762c1cb3
...
@@ -2,4 +2,27 @@
...
@@ -2,4 +2,27 @@
print
'3. Operations'
print
'3. Operations'
print
'XXX Not yet implemented'
print
'XXX Mostly not yet implemented'
print
'3.1 Dictionary lookups succeed even if __cmp__() raises an exception'
# SourceForge bug #112558:
# http://sourceforge.net/bugs/?func=detailbug&bug_id=112558&group_id=5470
class
BadDictKey
:
def
__hash__
(
self
):
return
hash
(
self
.
__class__
)
def
__cmp__
(
self
,
other
):
if
isinstance
(
other
,
self
.
__class__
):
print
"raising error"
raise
RuntimeError
,
"gotcha"
return
other
d
=
{}
x1
=
BadDictKey
()
x2
=
BadDictKey
()
d
[
x1
]
=
1
d
[
x2
]
=
2
print
"No exception passed through."
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