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
9b7ae96b
Kaydet (Commit)
9b7ae96b
authored
Ock 07, 2017
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #29023: Clarify that ints and longs are always deterministic seeds for random.
üst
9220111f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
random.rst
Doc/library/random.rst
+9
-9
random.py
Lib/random.py
+4
-2
No files found.
Doc/library/random.rst
Dosyayı görüntüle @
9b7ae96b
...
...
@@ -71,17 +71,17 @@ from sources provided by the operating system.
Bookkeeping functions:
.. function:: seed(
[x]
)
.. function:: seed(
a=None
)
Initialize the basic random number generator. Optional argument *x* can be any
:term:`hashable` object. If *x* is omitted or ``None``, current system time is used;
current system time is also used to initialize the generator when the module is
first imported. If randomness sources are provided by the operating system,
they are used instead of the system time (see the :func:`os.urandom` function
for details on availability).
Initialize internal state of the random number generator.
If a :term:`hashable` object is given, deterministic results are only assured
when :envvar:`PYTHONHASHSEED` is disabled.
``None`` or no argument seeds from current time or from an operating
system specific randomness source if available (see the :func:`os.urandom`
function for details on availability).
If *a* is not ``None`` or an :class:`int` or a :class:`long`, then
``hash(a)`` is used instead. Note that the hash values for some types
are nondeterministic when :envvar:`PYTHONHASHSEED` is enabled.
.. versionchanged:: 2.4
formerly, operating system resources were not used.
...
...
Lib/random.py
Dosyayı görüntüle @
9b7ae96b
...
...
@@ -98,12 +98,14 @@ class Random(_random.Random):
self
.
gauss_next
=
None
def
seed
(
self
,
a
=
None
):
"""Initialize internal state
from hashable object
.
"""Initialize internal state
of the random number generator
.
None or no argument seeds from current time or from an operating
system specific randomness source if available.
If a is not None or an int or long, hash(a) is used instead.
If a is not None or is an int or long, hash(a) is used instead.
Hash values for some types are nondeterministic when the
PYTHONHASHSEED environment variable is enabled.
"""
if
a
is
None
:
...
...
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