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.

Author terry.reedy
Recipients Lukasa, Nofar Schnider, glyph, rhettinger, terry.reedy
Date 2016-08-15.03:44:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1471232656.46.0.733886655048.issue27706@psf.upfronthosting.co.za>
In-reply-to
Content
I agree with the value of a Reproducibility guarantee.  (The new section appears to have been added -- by Raymond -- in 3.2.)  For instance, people posting play-through videos using reproducible random maps typically post the 'seed' and I have seen memorable phrases rather than ints used.  I can imagine myself publishing seeds in other contexts.

In 3.2, seed gained a 2nd parameter -- 'version'.  "With version 2 (the default), a str, bytes, or bytearray object gets converted to an int and all of its bits are used."  For this case, hashing is not an issue. But 'conversion to int' is. Did it change with the introduction of FSR in 3.3?  It certainly should be frozen now, and the fact noted in the code.

For other non-int objects, a hashable is required.  (I expect anything other than int or string-like to be rare.) The doc does not say so (it should), but the dosctring does and experiment with [] confirms.

"With version 1, the hash() of a is used instead."

For hashed objects, whether version is 1 or 2, I guess the best we can do is to restore the fixed hash once used.

For a fixed sequence of outputs, both seed and rng have to be fixed.  2.7 still has WichmannHill for this reason.  It is gone in 3.x.  It the rng is significantly changed (different sequence for the same seed), I believe the seed version should be changed also.
History
Date User Action Args
2016-08-15 03:44:16terry.reedysetrecipients: + terry.reedy, rhettinger, glyph, Lukasa, Nofar Schnider
2016-08-15 03:44:16terry.reedysetmessageid: <1471232656.46.0.733886655048.issue27706@psf.upfronthosting.co.za>
2016-08-15 03:44:16terry.reedylinkissue27706 messages
2016-08-15 03:44:15terry.reedycreate