Index: Doc/lib/libstring.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstring.tex,v retrieving revision 1.45.8.4 diff -c -r1.45.8.4 libstring.tex *** Doc/lib/libstring.tex 4 Mar 2003 17:44:34 -0000 1.45.8.4 --- Doc/lib/libstring.tex 19 Mar 2003 01:25:21 -0000 *************** *** 243,248 **** --- 243,249 ---- removed. If given and not \code{None}, \var{chars} must be a string; the characters in the string will be stripped from the beginning of the string this method is called on. + \versionchanged[Support for the \var{chars} argument]{2.2.3} \end{funcdesc} \begin{funcdesc}{rstrip}{s\optional{, chars}} *************** *** 251,256 **** --- 252,258 ---- removed. If given and not \code{None}, \var{chars} must be a string; the characters in the string will be stripped from the end of the string this method is called on. + \versionchanged[Support for the \var{chars} argument]{2.2.3} \end{funcdesc} \begin{funcdesc}{strip}{s\optional{, chars}} *************** *** 259,266 **** characters are removed. If given and not \code{None}, \var{chars} must be a string; the characters in the string will be stripped from the both ends of the string this method is called on. ! \versionchanged[The \var{chars} parameter was added. The \var{chars} ! parameter cannot be passed in 2.2 or 2.2.1]{2.2.2} \end{funcdesc} \begin{funcdesc}{swapcase}{s} --- 261,267 ---- characters are removed. If given and not \code{None}, \var{chars} must be a string; the characters in the string will be stripped from the both ends of the string this method is called on. ! \versionchanged[Support for the \var{chars} argument]{2.2.3} \end{funcdesc} \begin{funcdesc}{swapcase}{s} Index: Lib/string.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/string.py,v retrieving revision 1.60.16.4 diff -c -r1.60.16.4 string.py *** Lib/string.py 14 Nov 2002 03:32:08 -0000 1.60.16.4 --- Lib/string.py 19 Mar 2003 01:25:22 -0000 *************** *** 85,107 **** return s.strip(chars) # Strip leading tabs and spaces ! def lstrip(s): ! """lstrip(s) -> string Return a copy of the string s with leading whitespace removed. """ ! return s.lstrip() # Strip trailing tabs and spaces ! def rstrip(s): ! """rstrip(s) -> string ! Return a copy of the string s with trailing whitespace ! removed. """ ! return s.rstrip() # Split a string into a list of space/tab-separated words --- 85,110 ---- return s.strip(chars) # Strip leading tabs and spaces ! def lstrip(s, chars=None): ! """lstrip(s [,chars]) -> string Return a copy of the string s with leading whitespace removed. + If chars is given and not None, remove characters in sep instead. + If chars is unicode, S will be converted to unicode before stripping. """ ! return s.lstrip(chars) # Strip trailing tabs and spaces ! def rstrip(s, chars=None): ! """rstrip(s [,chars]) -> string ! Return a copy of the string s with trailing whitespace removed. ! If chars is given and not None, remove characters in sep instead. ! If chars is unicode, S will be converted to unicode before stripping. """ ! return s.rstrip(chars) # Split a string into a list of space/tab-separated words Index: Objects/stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.147.6.12 diff -c -r2.147.6.12 stringobject.c *** Objects/stringobject.c 2 Jan 2003 22:08:34 -0000 2.147.6.12 --- Objects/stringobject.c 19 Mar 2003 01:25:23 -0000 *************** *** 1523,1534 **** static char strip__doc__[] = ! "S.strip([sep]) -> string or unicode\n\ \n\ Return a copy of the string S with leading and trailing\n\ whitespace removed.\n\ ! If sep is given and not None, remove characters in sep instead.\n\ ! If sep is unicode, S will be converted to unicode before stripping"; static PyObject * string_strip(PyStringObject *self, PyObject *args) --- 1523,1534 ---- static char strip__doc__[] = ! "S.strip([chars]) -> string or unicode\n\ \n\ Return a copy of the string S with leading and trailing\n\ whitespace removed.\n\ ! If chars is given and not None, remove characters in chars instead.\n\ ! If chars is unicode, S will be converted to unicode before stripping"; static PyObject * string_strip(PyStringObject *self, PyObject *args) *************** *** 1541,1551 **** static char lstrip__doc__[] = ! "S.lstrip([sep]) -> string or unicode\n\ \n\ Return a copy of the string S with leading whitespace removed.\n\ ! If sep is given and not None, remove characters in sep instead.\n\ ! If sep is unicode, S will be converted to unicode before stripping"; static PyObject * string_lstrip(PyStringObject *self, PyObject *args) --- 1541,1551 ---- static char lstrip__doc__[] = ! "S.lstrip([chars]) -> string or unicode\n\ \n\ Return a copy of the string S with leading whitespace removed.\n\ ! If chars is given and not None, remove characters in chars instead.\n\ ! If chars is unicode, S will be converted to unicode before stripping"; static PyObject * string_lstrip(PyStringObject *self, PyObject *args) *************** *** 1558,1568 **** static char rstrip__doc__[] = ! "S.rstrip([sep]) -> string or unicode\n\ \n\ Return a copy of the string S with trailing whitespace removed.\n\ ! If sep is given and not None, remove characters in sep instead.\n\ ! If sep is unicode, S will be converted to unicode before stripping"; static PyObject * string_rstrip(PyStringObject *self, PyObject *args) --- 1558,1568 ---- static char rstrip__doc__[] = ! "S.rstrip([chars]) -> string or unicode\n\ \n\ Return a copy of the string S with trailing whitespace removed.\n\ ! If chars is given and not None, remove characters in chars instead.\n\ ! If chars is unicode, S will be converted to unicode before stripping"; static PyObject * string_rstrip(PyStringObject *self, PyObject *args) Index: Objects/unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.124.6.20 diff -c -r2.124.6.20 unicodeobject.c *** Objects/unicodeobject.c 11 Feb 2003 23:19:29 -0000 2.124.6.20 --- Objects/unicodeobject.c 19 Mar 2003 01:25:25 -0000 *************** *** 4569,4580 **** static char strip__doc__[] = ! "S.strip([sep]) -> unicode\n\ \n\ Return a copy of the string S with leading and trailing\n\ whitespace removed.\n\ ! If sep is given and not None, remove characters in sep instead.\n\ ! If sep is a str, it will be converted to unicode before stripping"; static PyObject * unicode_strip(PyUnicodeObject *self, PyObject *args) --- 4569,4580 ---- static char strip__doc__[] = ! "S.strip([chars]) -> unicode\n\ \n\ Return a copy of the string S with leading and trailing\n\ whitespace removed.\n\ ! If chars is given and not None, remove characters in chars instead.\n\ ! If chars is a str, it will be converted to unicode before stripping"; static PyObject * unicode_strip(PyUnicodeObject *self, PyObject *args) *************** *** 4587,4597 **** static char lstrip__doc__[] = ! "S.lstrip([sep]) -> unicode\n\ \n\ Return a copy of the string S with leading whitespace removed.\n\ ! If sep is given and not None, remove characters in sep instead.\n\ ! If sep is a str, it will be converted to unicode before stripping"; static PyObject * unicode_lstrip(PyUnicodeObject *self, PyObject *args) --- 4587,4597 ---- static char lstrip__doc__[] = ! "S.lstrip([chars]) -> unicode\n\ \n\ Return a copy of the string S with leading whitespace removed.\n\ ! If chars is given and not None, remove characters in chars instead.\n\ ! If chars is a str, it will be converted to unicode before stripping"; static PyObject * unicode_lstrip(PyUnicodeObject *self, PyObject *args) *************** *** 4604,4614 **** static char rstrip__doc__[] = ! "S.rstrip([sep]) -> unicode\n\ \n\ Return a copy of the string S with trailing whitespace removed.\n\ ! If sep is given and not None, remove characters in sep instead.\n\ ! If sep is a str, it will be converted to unicode before stripping"; static PyObject * unicode_rstrip(PyUnicodeObject *self, PyObject *args) --- 4604,4614 ---- static char rstrip__doc__[] = ! "S.rstrip([chars]) -> unicode\n\ \n\ Return a copy of the string S with trailing whitespace removed.\n\ ! If chars is given and not None, remove characters in chars instead.\n\ ! If chars is a str, it will be converted to unicode before stripping"; static PyObject * unicode_rstrip(PyUnicodeObject *self, PyObject *args)