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
c1ac194e
Kaydet (Commit)
c1ac194e
authored
Ara 07, 2002
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Clarify and speedup test.
üst
babc83a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
random.py
Lib/random.py
+3
-2
No files found.
Lib/random.py
Dosyayı görüntüle @
c1ac194e
...
@@ -774,8 +774,9 @@ def _test_sample(n):
...
@@ -774,8 +774,9 @@ def _test_sample(n):
population
=
xrange
(
n
)
population
=
xrange
(
n
)
for
k
in
xrange
(
n
+
1
):
for
k
in
xrange
(
n
+
1
):
s
=
sample
(
population
,
k
)
s
=
sample
(
population
,
k
)
assert
len
(
dict
([(
elem
,
True
)
for
elem
in
s
]))
==
len
(
s
)
==
k
uniq
=
dict
.
fromkeys
(
s
)
assert
None
not
in
s
assert
len
(
uniq
)
==
len
(
s
)
==
k
assert
None
not
in
uniq
def
_sample_generator
(
n
,
k
):
def
_sample_generator
(
n
,
k
):
# Return a fixed element from the sample. Validates random ordering.
# Return a fixed element from the sample. Validates random ordering.
...
...
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