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
c585eecf
Kaydet (Commit)
c585eecf
authored
Eyl 07, 2010
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix test that depends on a particular implementation of random.choice().
üst
a300007c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
27 deletions
+24
-27
random.py
Lib/random.py
+2
-5
test_generators.py
Lib/test/test_generators.py
+22
-22
No files found.
Lib/random.py
Dosyayı görüntüle @
c585eecf
...
@@ -136,7 +136,7 @@ class Random(_random.Random):
...
@@ -136,7 +136,7 @@ class Random(_random.Random):
# really unsigned 32-bit ints, so we convert negative ints from
# really unsigned 32-bit ints, so we convert negative ints from
# version 2 to positive longs for version 3.
# version 2 to positive longs for version 3.
try
:
try
:
internalstate
=
tuple
(
x
%
(
2
**
32
)
for
x
in
internalstate
)
internalstate
=
tuple
(
x
%
(
2
**
32
)
for
x
in
internalstate
)
except
ValueError
as
e
:
except
ValueError
as
e
:
raise
TypeError
from
e
raise
TypeError
from
e
super
(
Random
,
self
)
.
setstate
(
internalstate
)
super
(
Random
,
self
)
.
setstate
(
internalstate
)
...
@@ -214,10 +214,7 @@ class Random(_random.Random):
...
@@ -214,10 +214,7 @@ class Random(_random.Random):
def
_randbelow
(
self
,
n
,
int
=
int
,
_maxwidth
=
1
<<
BPF
,
type
=
type
,
def
_randbelow
(
self
,
n
,
int
=
int
,
_maxwidth
=
1
<<
BPF
,
type
=
type
,
_Method
=
_MethodType
,
_BuiltinMethod
=
_BuiltinMethodType
):
_Method
=
_MethodType
,
_BuiltinMethod
=
_BuiltinMethodType
):
"""Return a random int in the range [0,n)
"""Return a random int in the range [0,n). Raises ValueError if n==0.
Handles the case where n has more bits than returned
by a single call to the underlying generator.
"""
"""
getrandbits
=
self
.
getrandbits
getrandbits
=
self
.
getrandbits
...
...
Lib/test/test_generators.py
Dosyayı görüntüle @
c585eecf
...
@@ -458,30 +458,30 @@ Subject: Re: PEP 255: Simple Generators
...
@@ -458,30 +458,30 @@ Subject: Re: PEP 255: Simple Generators
... else:
... else:
... break
... break
A->A B->B C->C D->D E->E F->F G->G H->H I->I J->J K->K L->L M->M
A->A B->B C->C D->D E->E F->F G->G H->H I->I J->J K->K L->L M->M
merged I into A
merged K into B
A->A B->B C->C D->D E->E F->F G->G H->H I->A J->J K->K L->L M->M
A->A B->B C->C D->D E->E F->F G->G H->H I->I J->J K->B L->L M->M
merged D into C
A->A B->B C->C D->C E->E F->F G->G H->H I->A J->J K->K L->L M->M
merged K into H
A->A B->B C->C D->C E->E F->F G->G H->H I->A J->J K->H L->L M->M
merged L into A
A->A B->B C->C D->C E->E F->F G->G H->H I->A J->J K->H L->A M->M
merged E into A
A->A B->B C->C D->C E->A F->F G->G H->H I->A J->J K->H L->A M->M
merged B into G
A->A B->G C->C D->C E->A F->F G->G H->H I->A J->J K->H L->A M->M
merged A into F
merged A into F
A->F B->
G C->C D->C E->F F->F G->G H->H I->F J->J K->H L->F
M->M
A->F B->
B C->C D->D E->E F->F G->G H->H I->I J->J K->B L->L
M->M
merged
H into G
merged
E into F
A->F B->
G C->C D->C E->F F->F G->G H->G I->F J->J K->G L->F
M->M
A->F B->
B C->C D->D E->F F->F G->G H->H I->I J->J K->B L->L
M->M
merged
F into J
merged
D into C
A->
J B->G C->C D->C E->J F->J G->G H->G I->J J->J K->G L->J
M->M
A->
F B->B C->C D->C E->F F->F G->G H->H I->I J->J K->B L->L
M->M
merged M into C
merged M into C
A->J B->G C->C D->C E->J F->J G->G H->G I->J J->J K->G L->J M->C
A->F B->B C->C D->C E->F F->F G->G H->H I->I J->J K->B L->L M->C
merged J into G
merged J into B
A->G B->G C->C D->C E->G F->G G->G H->G I->G J->G K->G L->G M->C
A->F B->B C->C D->C E->F F->F G->G H->H I->I J->B K->B L->L M->C
merged C into G
merged B into C
A->G B->G C->G D->G E->G F->G G->G H->G I->G J->G K->G L->G M->G
A->F B->C C->C D->C E->F F->F G->G H->H I->I J->C K->C L->L M->C
merged F into G
A->G B->C C->C D->C E->G F->G G->G H->H I->I J->C K->C L->L M->C
merged L into C
A->G B->C C->C D->C E->G F->G G->G H->H I->I J->C K->C L->C M->C
merged G into I
A->I B->C C->C D->C E->I F->I G->I H->H I->I J->C K->C L->C M->C
merged I into H
A->H B->C C->C D->C E->H F->H G->H H->H I->H J->C K->C L->C M->C
merged C into H
A->H B->H C->H D->H E->H F->H G->H H->H I->H J->H K->H L->H M->H
"""
"""
# Emacs turd '
# Emacs turd '
...
...
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