[Python-Dev] [1.6]: UserList, Dict: Do we need a UserString class?

Guido van Rossum guido@python.org
Tue, 28 Mar 2000 14:22:43 -0500


> > Do we need a UserString class?
> 
> This will probably be useful on top of the i18n stuff in due course,
> so I'd like it.
> 
> Something Mike Da Silva and I have discussed a lot is implementing a
> higher-level 'typed string' library on top of the Unicode stuff.  
> A 'typed string' is like a string, but knows what encoding it is in -
> possibly Unicode, possibly a native encoding and embodies some basic
> type safety and convenience notions, like not being able to add a
> Shift-JIS and an EUC string together.  Iteration would always be per
> character, not per byte; and a certain amount of magic would say that
> if the string was (say) Japanese, it would acquire a few extra methods
> for doing some Japan-specific things like expanding half-width
> katakana.
> 
> Of course, we can do this anyway, but I think defining the API clearly
> in UserString is a great idea.

Agreed.  Please somebody send a patch!

--Guido van Rossum (home page: http://www.python.org/~guido/)