Author boris
Recipients boris
Date 2021-02-01.03:01:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1612148504.79.0.846022332701.issue43089@roundup.psfhosted.org>
In-reply-to
Content
The documentation https://docs.python.org/3/library/random.html#random.Random says:

> class random.Random([seed])ΒΆ

But in reality the parameter is called "x" not "seed" (CPython 3.9):

>>> import random
>>> random.Random(seed=0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'seed'
>>> random.Random(x=0)
<random.Random object at 0x20ddc10>

Same goes for random.SystemRandom

It would be better to rename "x" to "seed" but that's not backwards compatible.
History
Date User Action Args
2021-02-01 03:01:44borissetrecipients: + boris
2021-02-01 03:01:44borissetmessageid: <1612148504.79.0.846022332701.issue43089@roundup.psfhosted.org>
2021-02-01 03:01:44borislinkissue43089 messages
2021-02-01 03:01:44boriscreate