New submission from Борис Верховский <boris.v...@gmail.com>:

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.

----------
components: Library (Lib)
messages: 386052
nosy: boris
priority: normal
pull_requests: 23224
severity: normal
status: open
title: The optional argument to random.Random() is called "x" not "seed"
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43089>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

  • ... Борис Верховский
    • ... శ్రీనివాస్ రెడ్డి తాటిపర్తి
    • ... Serhiy Storchaka
    • ... Raymond Hettinger

Reply via email to