[Python-ideas] PEP 504: Using the system RNG by default

Tim Peters tim.peters at gmail.com
Wed Sep 16 18:09:55 CEST 2015


[Guido]
>> ...
>> Tim's proposal is simple: create a new module, e.g. safefandom, with the
>> same API as random (less seed/state). That's it. Then it's a simple import
>> change away to do the right thing, and we have years to seed StackOverflow
>> with better information before that code even hits the road. (But a backport
>> to Python 2.7 could be on PyPI tomorrow!)

[Nick Coghlan <ncoghlan at gmail.com>]
> If folks are reaching for a third party library anyway, we'd be better
> off point them at one of the higher levels ones like passlib or
> cryptography.

Note that, in context, "saferandom" _would_ be a standard module in a
future Python 3 feature release.  But it _could_ be used literally
tomorrow by anyone who wanted a head start, whether in a current
Python 2 or Python 3.

And if pieces of `passlib` and/or `cryptography` are thought to be
essential for best practice, cool, then `saferandom` could also become
a natural home for workalikes.  Would you really want to _ever_ put
such functions in the catch-all "random" module?  The docs would
become an incomprehensible mess.


More information about the Python-ideas mailing list