Skip to content

Mention hash randomization in random lib bpo-40325#19596

Closed
kwikwag wants to merge 3 commits intopython:masterfrom
kwikwag:patch-1
Closed

Mention hash randomization in random lib bpo-40325#19596
kwikwag wants to merge 3 commits intopython:masterfrom
kwikwag:patch-1

Conversation

@kwikwag
Copy link
Copy Markdown

@kwikwag kwikwag commented Apr 19, 2020

@kwikwag kwikwag requested a review from rhettinger as a code owner April 19, 2020 09:23
@the-knights-who-say-ni
Copy link
Copy Markdown

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
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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