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

Mention hash randomization in random lib bpo-40325 #19596

Closed
wants to merge 3 commits into from

Conversation

kwikwag
Copy link

@kwikwag kwikwag commented Apr 19, 2020

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@kwikwag

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels Apr 19, 2020
@kwikwag kwikwag changed the title Mention hash randomization in random lib Mention hash randomization in random lib bpo-40325 Apr 19, 2020
Doc/library/random.rst Outdated Show resolved Hide resolved
blurb-it bot and others added 2 commits April 19, 2020 09:35
Co-Authored-By: Rémi Lapeyre <remi.lapeyre@henki.fr>
@rhettinger
Copy link
Contributor

Thanks for the patch, but I'm going to decline. Hash randomization has system wide effects and nothing that are specific to the random() module. The only relation is that they share the word "random" :-)

@rhettinger rhettinger closed this Apr 20, 2020
@rhettinger
Copy link
Contributor

Feel free to suggest a general FAQ entry on hash randomization, noting that any sequence formed by a list of a set of strings will be in non-deterministic order.

@kwikwag
Copy link
Author

kwikwag commented May 21, 2020

Thanks for the patch, but I'm going to decline. Hash randomization has system wide effects and nothing that are specific to the random() module. The only relation is that they share the word "random" :-)

Hey, thanks for the comment. While a FAQ entry is indeed relevant, I think that so is a mention in random - a user like me expected deterministic behavior when using random.seed(), didn't get such a behavior, and consulted the docs for random for some insight. Users should be aware that there are other sources of randomness in otherwise deterministic code -- the use of the same word, random, is not happenstance. These are two sources (and the only sources?) of pseudo-randomness built into Python. Hash randomization is obligatory, while random is opt-in. It makes sense to me that docs for an opt-in approach would mention the obligatory one(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants