[Python-3000] string module trimming
barry at python.org
Tue Apr 17 22:58:19 CEST 2007
-----BEGIN PGP SIGNED MESSAGE-----
On Apr 17, 2007, at 1:27 PM, Neal Norwitz wrote:
> On 4/17/07, Barry Warsaw <barry at python.org> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> On Apr 17, 2007, at 5:03 AM, Neal Norwitz wrote:
>> > * maketrans remains (also implemented in stropmodule.c). It is
>> > used 11 times.
>> > * ascii_letters is used 17 times
>> > * ascii_lowercase is used 2 times
>> > * digits is used 15 times
>> > * hexdigits is used 2 times
>> > * letters is used 9 times
>> > * whitespace is used 4 times
>> You're not planning on removing these too are you?
> I don't have any plans, just considering options. Move them
> somewhere? Perhaps, trim the ones that are unused. In a unicode
> world, I'm not sure how much some of these make sense. letters stands
> out more than others. I don't know enough about unicode to know if
> digits or whitespace can be diff.
Certainly it makes sense to keep the ascii_* constants. The docs say
letters and lowercase are locale-aware, so I guess it makes sense to
keep those too.
> The Template class is in string, which seems pretty appropriate.
> Although with the naming re-org that will be coming, should string be
> renamed to stringlib (or whatever)?
I don't know, I think 'string' still works fine for me.
> What would you like to see for things like maketrans, capwords, etc?
I've used them both a few times, so I guess I'd be fine with keeping
them where they are. capwords() seems easy enough to write the one
or two times I'd need it, so I don't have strong feelings about them.
I know at one point there was talk about a 'text' or 'textlib'
package, which might serve as a way to organize such other modules as
textwrap, *StringIO, etc.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
-----END PGP SIGNATURE-----
More information about the Python-3000