[Python-ideas] Pre-PEP Adding A Secrets Module To The Standard Library
Random832
random832 at fastmail.com
Sun Sep 20 08:45:31 CEST 2015
"Stephen J. Turnbull" <stephen at xemacs.org>
writes:
> Chris Angelico writes:
>
> > My personal preference for shed colour: token_bytes returns a
> > bytestring, its length being the number provided. All the others
> > return Unicode strings, their lengths again being the number provided.
> > So they're all text bar the one that explicitly says it's in bytes.
>
> I think that token_url may need a bytes mode, for the same reasons
> that bytes needs __mod__: such tokens will often be created and parsed
> by programs that never leave the "ASCII-compatible bytes" world.
For token_alpha the obvious answer is to return the same type as
alphabet, which there's no reason not to allow be either.
More information about the Python-ideas
mailing list