Issue 33292: Fix secrets.randbelow docstring
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) * ![]() |
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) * ![]() |
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) * ![]() |
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) * ![]() |
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:59 | admin | set | github: 77473 |
| 2018-04-18 09:47:59 | Nixawk | set | messages: + msg315443 |
| 2018-04-18 07:49:08 | mark.dickinson | set | nosy:
+ mark.dickinson messages: + msg315440 |
| 2018-04-17 13:32:17 | steven.daprano | set | messages: + msg315395 |
| 2018-04-17 10:09:21 | serhiy.storchaka | set | status: open -> closed resolution: not a bug messages: + msg315387 stage: patch review -> resolved |
| 2018-04-17 09:09:18 | Nixawk | set | messages: + msg315383 |
| 2018-04-17 05:29:45 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka, steven.daprano messages: + msg315378 |
| 2018-04-17 03:11:57 | python-dev | set | keywords:
+ patch stage: patch review pull_requests: + pull_request6194 |
| 2018-04-17 03:09:36 | Nixawk | create | |
