[Python-ideas] Pre-PEP Adding A Secrets Module To The Standard Library

Terry Reedy tjreedy at udel.edu
Mon Sep 21 23:32:44 CEST 2015

On 9/21/2015 12:22 PM, Steven D'Aprano wrote:
> On Sun, Sep 20, 2015 at 09:00:08AM +0300, Serhiy Storchaka wrote:

>> randbelow() is just an alias for randrange() with single argument.
>> randint(a, b) == randrange(a, b+1).
>> These functions are redundant and they have non-zero cost.
> But they already exist in the random module, so adding them to secrets
> doesn't cost anything extra.

I think the redundancy in random is a mistake.  The cost is confusion 
and extra memory load, and there need to more ofter refer to the manual, 
for essentially zero gain.  When I read two names, I expect them to do 
two different things.  The question is whether to propagate the mistake 
to a new module.

Terry Jan Reedy

More information about the Python-ideas mailing list