This is the section from Dive Into Python 3 regarding strings:
In Python 3, all strings are Unicode character sequences. There is no such thing as a Python string encoded in utf-8 or a Python string encoded as CP-1252. "Is this a utf-8 string?" is an invalid question. utf-8 is a way to encode characters as a sequence of bytes. If you want to take a string and turn it into a sequence of bytes in a specific character encoding, Python 3 will help you with this. If you want to take a sequence of bytes and turn it into a string, Python 3 will also help you with this. Bytes are not characters; bytes are bytes. Symbols are an abstraction. A string is a sequence of these abstractions.
Earlier today I used the module hashliband read the help text for md5, which reads:
Returns a new hash file MD5; possibly initialized with a string.
Well, he does not accept string- he accepts the object bytes.
Maybe I read too much about this, but it doesn't make sense if you should use the help text instead bytes? Or do people use the same name for strings and bytes?
source
share