[Python-Dev] Re: String module

Guido van Rossum guido@python.org
Thu, 30 May 2002 08:49:31 -0400

> Right now in string.py, there is:
> 	from strop import maketrans, lowercase, uppercase, whitespace
> 	letters = lowercase + uppercase
> However, lowercase, uppercase, and letters are already defined
> in string.py.  It seems the only function being used from strop
> is maketrans.  Is this correct?  Should the others be removed 
> from string.py?

strop.letters etc. are fixed when locale.setconv(LC_CTYPE, ...) is
used.  string.letters etc. are *also* fixed, but if string hasn't been
imported yet when the locale is set, string gets the properly
localized versions from strop (which does the right thing upon
initialization to reflect the locale).  This mechanism would have to
be copied into string.py somehow.

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