Greg Ewing wrote:
> Guido van Rossum wrote:
>> Personally, I still think that converting to the latin-1 encoding is
>> probably just as good for this particular use case.
> 
> Although that's a conceptually screwy thing to do
> when your data has nothing to do with characters.

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?

A separate frozenbytes type (with the bytes API instead of the string 
API) would solve the problem far more cleanly.

Easy-for-me-to-say-when-I'm-not-providing-the-code-'ly yours,
Nick.


-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
_______________________________________________
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

Reply via email to