[Python-3000] string module trimming (original) (raw)
Barry Warsaw barry at python.org
Tue Apr 17 22:58:19 CEST 2007
- Previous message: [Python-3000] string module trimming
- Next message: [Python-3000] string module trimming
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
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. > * asciiletters is used 17 times > * asciilowercase 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.
- -Barry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin)
iQCVAwUBRiU07HEjvBPtnXfVAQKcOQQAt/1r05QGcDJ5VYKQ6xo9v5oA7vGpxtCp oAZJJxreQOlXbxYjcupEzaX9pfFOTng3hGBmrSSspxivOK5v8kcKZvBfxf3Ndt2j DKAH8rH79IoZO4TCQ8ehuEBxA6v912YUJtLmcwIWxsgO+ZgEBeTDV8UaddxEWRWS mQRow+zP7ew= =CkXk -----END PGP SIGNATURE-----
- Previous message: [Python-3000] string module trimming
- Next message: [Python-3000] string module trimming
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]