RE: [Python-Dev] Unicode proposal: %-formatting ?
--- Tim Peters <tim_one@email.msn.com> wrote:
I'm more baffled about what "abc" should do. I didn't understand the t#/s# etc arguments, and how those do or don't relate to what str() does. On the face of it, the idea that a gazillion and one distinct encodings all get lumped into "a string object" without remembering their nature makes about as much sense as if Python were to treat all instances of all user-defined classes as being of a single InstanceType type <wink> -- except in the latter case you at least get a __class__ attribute to find your way home again.
Well said. When the core stuff is done, I'm going to implement a set of "TypedString" helper routines which will remember what they are encoded in and won't let you abuse them by concatenating or otherwise mixing different encodings. If you are consciously working with multi-encoding data, this higher level of abstraction is really useful. But I reckon that can be done in pure Python (just overload '%;, '+' etc. with some encoding checks). - Andy ===== Andy Robinson Robinson Analytics Ltd. ------------------ My opinions are the official policy of Robinson Analytics Ltd. They just vary from day to day. __________________________________________________ Do You Yahoo!? Bid and sell for free at http://auctions.yahoo.com
participants (1)
-
Andy Robinson