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: Fix secrets.randbelow docstring
Type: resource usage Stage: resolved
Components: Library (Lib) Versions: Python 3.8
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Nixawk, mark.dickinson, serhiy.storchaka, steven.daprano
Priority: normal Keywords: patch

Created on 2018-04-17 03:09 by Nixawk, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6497 closed python-dev, 2018-04-17 03:11
Messages (7)
msg315376 - (view) Author: Vex Woo (Nixawk) * Date: 2018-04-17 03:09
- https://github.com/python/cpython/blob/master/Lib/secrets.py#L28

Please fix

    """Return a random int in the range [0, n)."""

to 

    """Return a random int in the range(0, n)."""
msg315378 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-04-17 05:29
What is wrong with the current docstring?
msg315383 - (view) Author: Vex Woo (Nixawk) * Date: 2018-04-17 09:09
Please use () or []
msg315387 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-04-17 10:09
I don't think that intervals [0, n-1] or (-1, n) would look better than [0, n).
msg315395 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2018-04-17 13:32
Possibly you may not be familiar with interval notation?

https://www.mathsisfun.com/sets/intervals.html

Since this is Python and not maths, maybe we should rethink the wording.
msg315440 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2018-04-18 07:49
"""Return a random integer x satisfying 0 <= x < n""" ?
msg315443 - (view) Author: Vex Woo (Nixawk) * Date: 2018-04-18 09:47
It looks simple and good.
History
Date User Action Args
2022-04-11 14:58:59adminsetgithub: 77473
2018-04-18 09:47:59Nixawksetmessages: + msg315443
2018-04-18 07:49:08mark.dickinsonsetnosy: + mark.dickinson
messages: + msg315440
2018-04-17 13:32:17steven.dapranosetmessages: + msg315395
2018-04-17 10:09:21serhiy.storchakasetstatus: open -> closed
resolution: not a bug
messages: + msg315387

stage: patch review -> resolved
2018-04-17 09:09:18Nixawksetmessages: + msg315383
2018-04-17 05:29:45serhiy.storchakasetnosy: + serhiy.storchaka, steven.daprano
messages: + msg315378
2018-04-17 03:11:57python-devsetkeywords: + patch
stage: patch review
pull_requests: + pull_request6194
2018-04-17 03:09:36Nixawkcreate