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
16eb827b
Kaydet (Commit)
16eb827b
authored
Eyl 04, 2016
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Improve docs for random.seed()
üst
ab7b0a03
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
random.rst
Doc/library/random.rst
+5
-2
random.py
Lib/random.py
+5
-3
No files found.
Doc/library/random.rst
Dosyayı görüntüle @
16eb827b
...
@@ -63,8 +63,11 @@ Bookkeeping functions:
...
@@ -63,8 +63,11 @@ Bookkeeping functions:
If *a* is an int, it is used directly.
If *a* is an int, it is used directly.
With version 2 (the default), a :class:`str`, :class:`bytes`, or :class:`bytearray`
With version 2 (the default), a :class:`str`, :class:`bytes`, or :class:`bytearray`
object gets converted to an :class:`int` and all of its bits are used. With version 1,
object gets converted to an :class:`int` and all of its bits are used.
the :func:`hash` of *a* is used instead.
With version 1 (provided for reproducing random sequences from older versions
of Python), the algorithm for :class:`str` and :class:`bytes` generates a
narrower range of seeds.
.. versionchanged:: 3.2
.. versionchanged:: 3.2
Moved to the version 2 scheme which uses all of the bits in a string seed.
Moved to the version 2 scheme which uses all of the bits in a string seed.
...
...
Lib/random.py
Dosyayı görüntüle @
16eb827b
...
@@ -96,11 +96,13 @@ class Random(_random.Random):
...
@@ -96,11 +96,13 @@ class Random(_random.Random):
None or no argument seeds from current time or from an operating
None or no argument seeds from current time or from an operating
system specific randomness source if available.
system specific randomness source if available.
For version 2 (the default), all of the bits are used if *a* is a str,
bytes, or bytearray. For version 1, the hash() of *a* is used instead.
If *a* is an int, all bits are used.
If *a* is an int, all bits are used.
For version 2 (the default), all of the bits are used if *a* is a str,
bytes, or bytearray. For version 1 (provided for reproducing random
sequences from older versions of Python), the algorithm for str and
bytes generates a narrower range of seeds.
"""
"""
if
a
is
None
:
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