Depricated String Functions in Python
Donn Cave
donn at u.washington.edu
Thu Jul 20 12:31:13 EDT 2006
In article <mailman.8368.1153402047.27775.python-list at python.org>,
Steve Holden <steve at holdenweb.com> wrote:
> Anoop wrote:
> > Thanks Stefen
> >
> > let me be more specific how would i have to write the following
> > function in the deprecated format
> >
> > map(string.lower,list)
> >
> To avoid the deprecated usage you would use the unbound method of the
> str type (that's the type of all strings):
>
> >>> lst = ['Steve', 'Holden']
> >>> map(str.lower, lst)
> ['steve', 'holden']
Oh, excellent - the string module is dead, long live
the string module! I can replace string.join with
str.join, and never have to defile my code with that
' '.join(x) abomination.
Donn Cave, donn at u.washington.edu
More information about the Python-list
mailing list