![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
New submission from Yang Feng <charles.fy@foxmail.com>: In documentation of random.getstate(), it says: “random.getstate() Return an object capturing the current internal state of the generator. This object can be passed to setstate() to restore the state.” random.getstate() takes 0 argument and return the current setting for the weekday to start each week. However, when I give one argument to random.getstate(), the interpreter reports the following error: ----------------------------------------------
import random random.getstate(1) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: getstate() takes 1 positional argument but 2 were given
Here I have two doubts about the reported errors: 1. Is the TypeError correct? This should be an inconsistent argument number error. There is nothing to do with Type. 2. Is the detailed error correct? Doc says random.getstate() takes 0 argument, the reported error says getstate() take 1 positional argument. which is inconsistent. Besides, I pass one argument to random.getstate(), but the reported error says 2 were given. Environment: Python 3.10, Ubuntu 16.04 ---------- assignee: docs@python components: Documentation messages: 389535 nosy: CharlesFengY, docs@python priority: normal severity: normal status: open title: Incorrect argument errors for random.getstate() versions: Python 3.10 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43628> _______________________________________