close
The Wayback Machine - https://web.archive.org/web/20081217014530/http://python.about.com:80/od/pythonstandardlibrary/a/string-mod-4.htm

Python

  1. Home
  2. Computing & Technology
  3. Python

Deprecated Functions in Python's String Module

By Al Lukaszewski, About.com

The following functions have been deprecated as of Python 2.5. Each has been replaced by its counterpart among the built-in string methods. If you use them in code, you should not be surprised to get a deprecation warning. These functions will not be removed from Python until version 3.0. You therefore have until that release to update your codebase.

In the following references, s indicates the string to be modified. For the other arguments, see the corresponding built-in string method.

  • atof(s): Deprecated since Python 2.0. Use the float() built-in function.
  • atoi(s[, base]): Deprecated since Python 2.0. Use the int() built-in function.
  • atol(s[, base]): Deprecated since Python 2.0. Use the long() built-in function.
  • capitalize(word)
  • expandtabs(s[, tabsize])
  • find(s, sub[, start[,end]])
  • rfind(s, sub[, start[, end]])
  • index(s, sub[, start[, end]])
  • rindex(s, sub[, start[, end]])
  • count(s, sub[, start[, end]])
  • lower(s)
  • split(s[, sep[, maxsplit]])
  • rsplit(s[, sep[, maxsplit]])
  • splitfields(s[, sep[, maxsplit]])
  • join(words[, sep])
  • joinfields(words[, sep])
  • lstrip(s[, chars])
  • rstrip(s[, chars])
  • strip(s[, chars])
  • swapcase(s)
  • translate(s, table[, deletechars])
  • upper(s)
  • ljust(s, width)
  • rjust(s, width)
  • center(s, width)
  • zfill(s, width)
  • replace(str, old, new[, maxreplace])

More from About.com

Python

  1. Home
  2. Computing & Technology
  3. Python
  4. Python Library
  5. Python String Module - Deprecated String Functions