[Tutor] Finding all the letters in a string?
kent37 at tds.net
Tue Sep 18 12:45:59 CEST 2007
Luke Paireepinart wrote:
> Remember how people are always saying "don't use the string module
> unless necessary because string objects have most of the functionality
> built-in now"
> This is another case of that.
I think this advice is being a little overstated in this thread. The
string module itself is not deprecated. Many functions in the string
module are also available as methods of a string. These functions are
deprecated. You can see a list here:
There is nothing wrong with using the constants defined in the string
module such as string.ascii_letters. Template strings
(http://docs.python.org/lib/node40.html) were actually *added* to the
string module in Python 2.4. capwords() and maketrans() are available
only in the string module, not available as string methods.
More information about the Tutor