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
82cb9a23
Kaydet (Commit)
82cb9a23
authored
Tem 05, 2005
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add test for hash commutativity.
üst
2dfc168b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
test_set.py
Lib/test/test_set.py
+10
-0
No files found.
Lib/test/test_set.py
Dosyayı görüntüle @
82cb9a23
...
...
@@ -5,6 +5,7 @@ import operator
import
copy
import
pickle
import
os
from
random
import
randrange
,
shuffle
class
PassThru
(
Exception
):
pass
...
...
@@ -399,6 +400,15 @@ class TestFrozenSet(TestJointOps):
self
.
assertEqual
(
hash
(
self
.
thetype
(
'abcdeb'
)),
hash
(
self
.
thetype
(
'ebecda'
)))
# make sure that all permutations give the same hash value
n
=
100
seq
=
[
randrange
(
n
)
for
i
in
xrange
(
n
)]
results
=
set
()
for
i
in
xrange
(
200
):
shuffle
(
seq
)
results
.
add
(
hash
(
self
.
thetype
(
seq
)))
self
.
assertEqual
(
len
(
results
),
1
)
def
test_copy
(
self
):
dup
=
self
.
s
.
copy
()
self
.
assertEqual
(
id
(
self
.
s
),
id
(
dup
))
...
...
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