[Python-3000] string module trimming
Neal Norwitz
nnorwitz at gmail.com
Tue Apr 17 11:03:05 CEST 2007
I whacked almost everything in the string (and strop) module. Here
are some things left to do:
* capwords is defined and used only in one place:
./idlelib/testcode.py
ISTM, this can go.
* 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
Some of these uses are in test code.
There are a bunch of other constants that aren't used at all in the
stdlib. Below is the full list from my grep (which probably missed a
few uses due to from string import).
n
--
Lib/idlelib/UndoDelegator.py: string.ascii_letters + string.digits
Lib/idlelib/AutoComplete.py: string.ascii_letters + string.digits
Lib/idlelib/AutoComplete.py: string.ascii_letters + string.digits
Lib/idlelib/HyperParser.py: string.ascii_letters + string.digits
Lib/idlelib/HyperParser.py: string.ascii_letters
Lib/idlelib/keybindingDialog.py: string.ascii_lowercase + string.digits
Lib/idlelib/keybindingDialog.py: string.ascii_lowercase
Lib/idlelib/PyShell.py: string.ascii_letters + string.digits
Lib/idlelib/ScriptBinding.py: string.ascii_letters + string.digits
Lib/idlelib/AutoExpand.py: string.ascii_letters + string.digits
Lib/distutils/util.py: string.whitespace
Lib/distutils/util.py: string.whitespace
Lib/distutils/fancy_getopt.py: string.maketrans('-', '_')
Lib/distutils/fancy_getopt.py: string.maketrans(string.whitespace, '
' * len(string.whitespace))
Lib/bsddb/test/test_dbshelve.py: string.letters
Lib/bsddb/test/test_get_none.py: string.letters
Lib/bsddb/test/test_get_none.py: string.letters
Lib/bsddb/test/test_basics.py: string.letters
Lib/bsddb/test/test_queue.py: string.letters
Lib/bsddb/test/test_queue.py: string.letters
Lib/msilib/__init__.py: string.digits
Lib/plat-riscos/riscospath.py: string.ascii_letters
Lib/plat-riscos/rourl2path.py: string.maketrans("/.", "./")
Lib/test/test_csv.py: string.letters
Lib/test/test_pkgimport.py: string.letters
Lib/test/test_pkgimport.py: string.letters
Lib/test/test_md5.py: string.hexdigits
Lib/test/test_mimetools.py: string.ascii_letters + string.digits
Lib/test/test_pkg.py: "print(__name__, 'loading');
from . import string; print(string.spam)"),
Lib/test/test_hashlib.py: string.hexdigits
Lib/test/string_tests.py: string.maketrans('abc', 'xyz')
Lib/test/string_tests.py: string.maketrans
Lib/test/string_tests.py: string.maketrans('abc', 'xyz')
Lib/test/string_tests.py: string.maketrans('a', 'A')
Lib/test/test_urllib2.py: string.maketrans("/.", "./"))
Lib/test/test_bigmem.py: string.maketrans('.aZ', '-!$')
Lib/plat-mac/gensuitemodule.py: string.ascii_letters + '_'
Lib/plat-mac/gensuitemodule.py: string.digits
Lib/nturl2path.py: string.ascii_letters
Lib/pipes.py: string.ascii_letters + string.digits
Lib/textwrap.py: string.maketrans(_whitespace,
' ' * len(_whitespace))
Lib/textwrap.py: string.lowercase
Lib/tokenize.py: string.ascii_letters
Lib/ntpath.py: string.ascii_letters + string.digits
Lib/Cookie.py: string.ascii_letters + string.digits
Lib/urllib.py: string.maketrans("", "")
Lib/cmd.py: string.ascii_letters + string.digits
More information about the Python-3000
mailing list