Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

secrets.randbits returns only nonnegative integers #123789

Closed
Kodiologist opened this issue Sep 6, 2024 · 3 comments
Closed

secrets.randbits returns only nonnegative integers #123789

Kodiologist opened this issue Sep 6, 2024 · 3 comments
Labels
docs Documentation in the Doc dir

Comments

@Kodiologist
Copy link
Contributor

Kodiologist commented Sep 6, 2024

Documentation

The docstring of secrets.randbits reads, in its entirety, "Return an int with k random bits." In fact, it only generates nonnegative integers, like its sister function random.getrandbits.

Linked PRs

@Kodiologist Kodiologist added the docs Documentation in the Doc dir label Sep 6, 2024
@AA-Turner
Copy link
Member

PR welcome!

A

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 8, 2024
…thonGH-123801)

(cherry picked from commit beee91c)

Co-authored-by: Wulian <1055917385@qq.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 8, 2024
…thonGH-123801)

(cherry picked from commit beee91c)

Co-authored-by: Wulian <1055917385@qq.com>
hauntsaninja pushed a commit that referenced this issue Sep 8, 2024
…H-123801) (#123831)

gh-123789: `secrets.randbits` returns only non-negative int (GH-123801)
(cherry picked from commit beee91c)

Co-authored-by: Wulian <1055917385@qq.com>
@Wulian233
Copy link
Contributor

Now we can close this🎉

@Kodiologist
Copy link
Contributor Author

Looks good. Thanks.

Yhg1s pushed a commit that referenced this issue Sep 24, 2024
…H-123801) (#123830)

gh-123789: `secrets.randbits` returns only non-negative int (GH-123801)
(cherry picked from commit beee91c)

Co-authored-by: Wulian <1055917385@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

3 participants