On 8/7/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 8/7/07, Nick Coghlan <[EMAIL PROTECTED]> wrote: > > 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. > But at a cost: an extra data type, more code to maintain, more docs to > write, thicker books, etc. I think that cost is already there, and we're making it even worse by trying to use the same name for two distinct concepts. (1) A mutable buffer (2) A literal which isn't "characters" Historically, most of the type(2) examples have just used ASCII (or at least Latin-1) for convenience, so that they *look* like characters. The actual requirements are on the bytes, though, so recoding them to a different output format is not OK. Also note that for type(2), immutability is important, not just for efficiency, but conceptually. These are generally compile-time constants, and letting them change *will* lead to confusion. (Even letting them get replaced is confusing, but that sort of monkey-patching is sufficiently rare and obvious that it seems to work out OK today.) -jJ _______________________________________________ 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
