3 ms·
You are not making useful comment because you don't understanding the use case. Python 2 is very useful in handling binary data. This complain is not about unic
by tungwaiyip 13y ago
You are not making useful comment because you don't understanding the use case. Python 2 is very useful in handling binary data. This complain is not about unicode. This is about binary files manipulation.
I'm thrill about the unicode support. If they only add unicode string and leave the binary string alone and just require an additional literal prefix b, it will be an easy transition. Instead the design is changed for no good reason and the code are broken too.
- agentultra 13y agoI have a hard time believing that the design was arbitrarily changed. The request to add string-APIs to the bytes object have been brought up before [0]. I think the reasoning is quite clear: byte-strings are not textual objects. If you are sending textual-data to a byte-string API, build your string as a string and encode it to bytes. [0] http://bugs.python.org/issue3982 http://bugs.python.org/issue3982 For working with binary data there's a much cleaner API in Python 3 that is less prone to subtle encoding errors. edit: I realize there is contention but I'm of the mind that .format probably isn't the right method and that if there were one it'd need it's own format control string syntax.