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
145a4a0f
Kaydet (Commit)
145a4a0f
authored
Ock 07, 2003
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Much clearer when super() is used.
üst
a9cfa550
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
random.py
Lib/random.py
+5
-5
No files found.
Lib/random.py
Dosyayı görüntüle @
145a4a0f
...
...
@@ -58,9 +58,9 @@ SG_MAGICCONST = 1.0 + _log(4.5)
# Adrian Baddeley. Adapted by Raymond Hettinger for use with
# the Mersenne Twister core generator.
from
_random
import
Random
as
CoreGenerator
import
_random
class
Random
(
CoreGenerator
):
class
Random
(
_random
.
Random
):
"""Random number generator base class used by bound module functions.
Used to instantiate instances of Random to get generators that don't
...
...
@@ -94,19 +94,19 @@ class Random(CoreGenerator):
If a is not None or an int or long, hash(a) is used instead.
"""
CoreGenerator
.
seed
(
self
,
a
)
super
(
Random
,
self
)
.
seed
(
a
)
self
.
gauss_next
=
None
def
getstate
(
self
):
"""Return internal state; can be passed to setstate() later."""
return
self
.
VERSION
,
CoreGenerator
.
getstate
(
self
),
self
.
gauss_next
return
self
.
VERSION
,
super
(
Random
,
self
)
.
getstate
(
),
self
.
gauss_next
def
setstate
(
self
,
state
):
"""Restore internal state from object returned by getstate()."""
version
=
state
[
0
]
if
version
==
2
:
version
,
internalstate
,
self
.
gauss_next
=
state
CoreGenerator
.
setstate
(
self
,
internalstate
)
super
(
Random
,
self
)
.
setstate
(
internalstate
)
else
:
raise
ValueError
(
"state with version
%
s passed to "
"Random.setstate() of version
%
s"
%
...
...
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