
Sept. 20, 2015
6:45 a.m.
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.