
[Tim Peters]
Token functions .token_bytes(nbytes) another name for os.urandom() .token_hex(nbytes) same, but return string of ASCII hex digits .token_url(nbytes) same, but return URL-safe base64-encoded ASCII .token_alpha(alphabet, nchars) string of `nchars` characters drawn uniformly from `alphabet`
[Chris Angelico <rosuav@gmail.com>]
token_bytes "obviously" should return a bytes,
Which os.urandom() does in Python 3. I'm not writing docs, just suggesting the functions.
and token_alpha equally obviously should be returning a str.
Which part of "string" doesn't suggest "str"?
(Or maybe it should return the same type as alphabet, which could be either?)
: What about the other two?
Which part of "ASCII" is ambiguous?
Also, if you ask for 4 bytes from token_hex, do you get 4 hex digits or 8 (four bytes of entropy)?
And which part of "same"? ;-) Bikeshed away.; I'm outta this now ;-)