On 8/7/07, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Yeah, this approach seems to run counter to the whole point of getting > rid of the current str type: "for binary data use bytes, for text use > Unicode, unless you need your binary data to be hashable, and then you > decode it to gibberish Unicode via the latin-1 codec" > > This would mean that the Unicode type would acquire all of the ambiquity > currently associated with the 8-bit str type: does it contain actual > text, or does it contain arbitrary latin-1 decoded binary data?
Not necessarily, as this kind of use is typically very localized. Remember practicality beats purity. > A separate frozenbytes type (with the bytes API instead of the string > API) would solve the problem far more cleanly. But at a cost: an extra data type, more code to maintain, more docs to write, thicker books, etc. To me, the most important cost is that every time you need to use bytes you would have to think about whether to use frozen or mutable bytes. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
