Why is lower() deprecated and how should I replace it?

Robert Kern rkern at ucsd.edu
Sun Mar 13 09:55:27 CET 2005


gf gf wrote:
> I read that lower() is deprecated. 

Most of the functions in the string module are deprecated, yes. They 
have been replaced by string methods on the string objects themselves. 
These methods are *not* deprecated.


In [1]: s = 'I aM a hApPY lITtLe STRing thAt WAnTS to Be loWEr CaSE.'

In [2]: s.lower()
Out[2]: 'i am a happy little string that wants to be lower case.'

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter



More information about the Python-list mailing list