This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: random.randint docs
Type: Stage:
Components: Documentation Versions: Python 2.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, jgsack, orsenthil
Priority: normal Keywords:

Created on 2009-09-28 03:56 by jgsack, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg93190 - (view) Author: James G. sack (jim) (jgsack) Date: 2009-09-28 03:56
Docs for 2.6.2 (http://docs.python.org/library/random.html?
highlight=random#module-random)
presently say
"""
random.randint(a, b)
Return a random integer N such that a <= N <= b.
"""

It should say
...a <= N < b

I wonder if there are other mistakes there in upper limit docs?

~jim
msg93192 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2009-09-28 04:37
Not actually a bug. The documentation is correct.
Do, random.randint(0,1) a couple of times and you see 1 appearing.
If still not convinced, look into the random.py see that randint(a, b)
actually does a return self.randrange(a, b+1)
History
Date User Action Args
2022-04-11 14:56:53adminsetgithub: 51258
2009-09-28 04:37:24orsenthilsetstatus: open -> closed

nosy: + orsenthil
messages: + msg93192

resolution: not a bug
2009-09-28 03:56:44jgsackcreate